:root {
  --background: #fff;
  --text-titles: #1a1a1a;
  --text-content: #333;
  --code: #f7f7f9;
  --code-background: whitesmoke;
  --code-border: #dfe1e8;
  --border: #dedede;
  --menu: #212121;
  --sidebar: #fafafa;
}

body.night-mode {
  --background: #212121;
  --text: #fafafa;
  --text-titles: #fafafa;
  --text-content: #f1f1f1;
  --code: #000;
  --code-background: #101010;
  --code-border: #000;
  --border: #000;
  --menu: #fff;
  --sidebar: #1a1a1a;
}

/* Scaffolding and type */
* { box-sizing: border-box; }

html { font-size: 16px; }
@media (min-width: 48em) {
  html { font-size: 20px; }
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-content);
  background-color: var(--background);
}

header {
  position: fixed;
  z-index: 10;
  top: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 1rem;
  width: 100%;
  height: 60px;
  border-bottom: 1px solid var(--border);
  background-color: var(--background);
  font-size: 1.25rem;
  font-weight: 800;
  transition: width .2s cubic-bezier(0, 0, 0.3, 1);
  will-change: width;
}

@media (min-width: 64em) {
  .menu-toggled header {
    width: calc(100% - 280px);
  }
}

header img { margin-right: 0.25rem; }

header button.settings {
  position: absolute;
  top: 0;
  right: 0;
  width: 50px;
  height: 100%;
  font-size: 18px;
  color: var(--text-content);
  border: none;
  background: transparent;
}

header .settings-shade {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

body.settings-open header .settings-shade {
  pointer-events: all;
}

header .settings-dropdown {
  position: absolute;
  z-index: 100;
  top: 10px;
  right: 10px;
  padding: 25px 0;
  width: 100%;
  max-width: 260px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  background-color: var(--background);
  border-radius: 6px;
  transform-origin: top right;
  transform: scale(0);
  opacity: 0;
  transition: transform 0.2s cubic-bezier(0,0,0.3,1) 0.2s, opacity 0.2s cubic-bezier(0,0,0.3,1) 0.2s;
}

body.settings-open header .settings-dropdown {
  transform: scale(1);
  opacity: 1;
  transition: transform 0.2s cubic-bezier(0,0,0.3,1), opacity 0.2s cubic-bezier(0,0,0.3,1);
}

header .settings-dropdown ul {
  margin: 0;
  padding: 0;
  list-style: none;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0,0,0.3,1);
}

body.settings-open header .settings-dropdown ul {
  opacity: 1;
  transition: opacity 0.2s cubic-bezier(0,0,0.3,1) 0.2s;
}

body.settings-open header .settings-dropdown ul li { display: flex; }

header .settings-dropdown button {
  padding: 10px;
  width: 100%;
  font-size: 16px;
  text-align: left;
  color: var(--text-content);
  border: none;
  background: transparent;
  cursor: pointer;
}

header .settings-dropdown ul li:hover {
  background-color: rgba(0,0,0,0.1);
}

body.night-mode header .settings-dropdown ul li:hover {
  background-color: rgba(255,255,255,0.1);
}

header .settings-dropdown button.night-mode::before {
  content: "Turn on Night Mode";
}

body.night-mode header .settings-dropdown button.night-mode::before {
  content: "Turn off Night Mode";
}

header button.menu {
  position: absolute;
  top: 0;
  left: 0;
  width: 50px;
  height: 100%;
  font-size: 20px;
  color: var(--text-content);
  border: none;
  background: transparent
}

a {
  color: #0088c6;
  text-decoration: none;
}
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  display: flex;
  align-items: center;
  margin: 0 0 .5rem;
  font-weight: normal;
  line-height: 1;
  color: var(--text-titles);
  letter-spacing: -.05em;
}
h1 { font-size: 3rem; }
h2 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 0;
}
h3 {
  margin-bottom: 1.4rem;
  font-size: 1.75rem;
}
h4 { font-size: 1.25rem }

h2 a,
h3 a {
  padding: 0 .5rem;
  font-size: 60%;
  color: inherit;
  opacity: .6;
}

.heading h2,
.section h3 { position: relative; }

.heading h2 > a,
.section h3 > a {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-100%, -50%);
  opacity: 0;
  transition: opacity 0.1s ease-in;
}

.heading h2:hover > a,
.section h3:hover > a { opacity: 0.5; }

h2 a:hover,
h3 a:hover {
  text-decoration: none;
}

p { margin: 0 0 1rem; }
.lead { font-size: 1.3rem; }

blockquote {
  position: relative;
  margin: 0 1rem 1rem;
  font-style: italic;
  color: #999;
}
blockquote p { margin-bottom: 0; }

ul li { margin-bottom: .25rem; }

/* Tighten up margin on last items */
p:last-child,
ul:last-child,
blockquote:last-child { margin-bottom: 0; }



/* Code */
code,
pre {
  font-family: "Source Code Pro", Menlo, "Courier New", monospace;
  font-size: 95%;
}
code {
  padding: 2px 4px;
  font-size: 85%;
  color: #d44950;
  background-color: var(--code);
  border-radius: .2rem;
}

pre {
  display: block;
  margin: 0 0 1rem;
  line-height: 1.4;
  white-space: pre;
  white-space: pre-wrap;
}
pre code {
  padding: 0;
  color: inherit;
  background-color: transparent;
  border: 0;
}
.highlight { margin: 0; }
.highlight pre { margin-bottom: 0; }
.highlight + .highlight { margin-top: 1rem; }


/* The Grid */
aside {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  padding: 1rem;
  width: 100%;
  height: 100%;
  background-color: transparent;
  pointer-events: all;
  will-change: transform;
}

.menu-toggled aside { pointer-events: none; }

@media (min-width: 64em) {
  aside { pointer-events: none; }
}

aside nav {
  position: absolute;
  z-index: 100;
  top: 0;
  left: 0;
  padding: 1rem;
  width: 100%;
  max-width: 280px;
  height: 100%;
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
  background-color: var(--sidebar);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: none;
  transition: transform .2s cubic-bezier(0, 0, 0.3, 1);
  pointer-events: all;
}

.menu-toggled aside nav { transform: translateX(-105%); }

@media (min-width: 64em) {
  aside nav {
    box-shadow: none;
    transform: translateX(-105%);
  }

  .menu-toggled aside nav { transform: none; }
}

main {
  position: relative;
  margin-left: auto;
  padding-top: 60px;
  width: 100%;
  transition: width .2s cubic-bezier(0, 0, 0.3, 1);
  will-change: width;
}

@media (min-width: 64em) {
  .menu-toggled main {
    width: calc(100% - 280px);
  }
}

.section {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  padding-top: 60px;
}

.col {
  flex: 0 0 100%;
  padding: 2rem 1rem;
}

.col p { max-width: 40rem; }

.col + .col {
  border: 1px solid var(--code-border);
  background-color: var(--code-background);
}

@media (min-width: 38em) {
  .col { padding: 2rem; }
}

@media (min-width: 48em) {
  .col {
    flex: 1;
    padding: 3rem;
  }
}

.section-title {
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-titles);
}

.section-title a { color: inherit; }
.section-title a:hover { text-decoration: none; }

.section-title svg { opacity: 0.8; }

.heading {
  padding: calc(2rem + 60px) 1rem 1.5rem;
}

@media (min-width: 38em) {
  .heading { padding: calc(3rem + 60px) 3rem 2.5rem; }
}

nav ul {
  padding-left: 0;
  font-size: .75rem;
  list-style: none;
}


.masthead {
  display: flex;
  align-items: flex-end;
  padding: 2rem;
  height: 40vh;
  background-color: #01a4e5;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.1);
}

@media (min-width: 64em) {
  .masthead {
    height: 30vw;
  }
}

.masthead h1 {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
}

.masthead .lead {
  font-size: 1rem;
  color: #fff;
}

@media (min-width: 64em) {
  .masthead h1 {
    font-size: 3rem;
  }

  .masthead .lead {
    font-size: 1.3rem;
  }
}

.footer {
  text-align: center;
  background-color: #262626;
  color: #fff;
  padding: 2rem;
}

.quick-links {
  list-style: none;
  margin-left: 0;
}

.quick-links li { display: inline; }

/* Syntax highlighting */

.hll { background-color: #ffc; }
 /*{ background: #f0f3f3; }*/
.c { color: #999; } /* Comment */
.err {
  color: #a00;
  background-color: #faa;
} /* Error */
.k { color: #069; } /* Keyword */
.o { color: #555; } /* Operator */
.cm { color: #999; } /* Comment.Multiline */ /* Edited to remove italics and make into comment */
.cp { color: #099; } /* Comment.Preproc */
.c1 { color: #999; } /* Comment.Single */
.cs { color: #999; } /* Comment.Special */
.gd {
  background-color: #fcc;
  border: 1px solid #c00;
} /* Generic.Deleted */
.ge { font-style: italic } /* Generic.Emph */
.gr { color: #f00; } /* Generic.Error */
.gh { color: #030; } /* Generic.Heading */
.gi {
  background-color: #cfc;
  border: 1px solid #0c0;
} /* Generic.Inserted */
.go { color: #aaa; } /* Generic.Output */
.gp { color: #009; } /* Generic.Prompt */
.gs { } /* Generic.Strong */
.gu { color: #030; } /* Generic.Subheading */
.gt { color: #9c6; } /* Generic.Traceback */
.kc { color: #069; } /* Keyword.Constant */
.kd { color: #069; } /* Keyword.Declaration */
.kn { color: #069; } /* Keyword.Namespace */
.kp { color: #069; } /* Keyword.Pseudo */
.kr { color: #069; } /* Keyword.Reserved */
.kt { color: #078; } /* Keyword.Type */
.m { color: #f60; } /* Literal.Number */
.s { color: #d44950; } /* Literal.String */
.na { color: #4f9fcf; } /* Name.Attribute */
.nb { color: #366; } /* Name.Builtin */
.nc { color: #0a8; } /* Name.Class */
.no { color: #360; } /* Name.Constant */
.nd { color: #99f; } /* Name.Decorator */
.ni { color: #999; } /* Name.Entity */
.ne { color: #c00; } /* Name.Exception */
.nf { color: #c0f; } /* Name.Function */
.nl { color: #99f; } /* Name.Label */
.nn { color: #ocf; } /* Name.Namespace */
.nt { color: #2f6f9f; } /* Name.Tag */
.nv { color: #033; } /* Name.Variable */
.ow { color: #000; } /* Operator.Word */
.w { color: #bbb; } /* Text.Whitespace */
.mf { color: #f60; } /* Literal.Number.Float */
.mh { color: #f60; } /* Literal.Number.Hex */
.mi { color: #f60; } /* Literal.Number.Integer */
.mo { color: #f60; } /* Literal.Number.Oct */
.sb { color: #c30; } /* Literal.String.Backtick */
.sc { color: #c30; } /* Literal.String.Char */
.sd {
  color: #c30;
  font-style: italic;
} /* Literal.String.Doc */
.s2 { color: #c30; } /* Literal.String.Double */
.se { color: #c30; } /* Literal.String.Escape */
.sh { color: #c30; } /* Literal.String.Heredoc */
.si { color: #a00; } /* Literal.String.Interpol */
.sx { color: #c30; } /* Literal.String.Other */
.sr { color: #3aa; } /* Literal.String.Regex */
.s1 { color: #c30; } /* Literal.String.Single */
.ss { color: #fc3; } /* Literal.String.Symbol */
.bp { color: #366; } /* Name.Builtin.Pseudo */
.vc { color: #033; } /* Name.Variable.Class */
.vg { color: #033; } /* Name.Variable.Global */
.vi { color: #033; } /* Name.Variable.Instance */
.il { color: #f60; } /* Literal.Number.Integer.Long */

.css .o,
.css .o + .nt,
.css .nt + .nt { color: #999; }

