/* Hand-coding your CSS isn't efficient, but it sure is fun! */

/*************
* Variables *
*************/

:root {
  /* Type */
  --sans-serif-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
    "Segoe UI Symbol";

  /* Metrics */
  --site-max-width: 46rem;

  /* Colors
   * These are the same as the .theme-light class below.
   */
  --text-color: #121a2f;
  --secondary-text-color: #5b96a5;
  --background-color: #fcfffb;
  --brand-color: rgb(255, 55, 75);
  --grey-color: rgb(55, 90, 99);
  --dark-grey-color: #5b96a5;
}

html.theme-light {
  --text-color: #121a2f;
  --secondary-text-color: #5b96a5;
  --background-color: #fcfffb;
  --brand-color: rgb(255, 55, 75);
  --grey-color: rgb(55, 90, 99);
  --dark-grey-color: #5b96a5;
}

html.theme-dark {
  --text-color: #fcfffb;
  --secondary-text-color: #5b96a5;
  --background-color: #121a2f;
  --brand-color: rgb(255, 55, 75);
  --grey-color: #5b96a5;
  --dark-grey-color: rgb(55, 90, 99);
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #fcfffb;
    --secondary-text-color: #5b96a5;
    --background-color: #121a2f;
    --brand-color: rgb(255, 55, 75);
    --grey-color: #5b96a5;
    --dark-grey-color: rgb(55, 90, 99);
  }
}

@media (prefers-color-scheme: light) {
  :root {
    --text-color: #121a2f;
    --secondary-text-color: #5b96a5;
    --background-color: #fcfffb;
    --brand-color: rgb(255, 55, 75);
    --grey-color: rgb(55, 90, 99);
    --dark-grey-color: #5b96a5;
  }
}

html.font-small {
  font-size: 80%;
}

html.font-medium {
  font-size: 100%;
}

html.font-large {
  font-size: 125%;
}

/***************
* Base Styles *
***************/

body {
  font-family: var(--sans-serif-font-family);
  background-color: var(--background-color);
  color: var(--text-color);

  -webkit-text-size-adjust: 100%;
  -webkit-font-feature-settings: "kern" 1;
  -moz-font-feature-settings: "kern" 1;
  -o-font-feature-settings: "kern" 1;
  font-feature-settings: "kern" 1;
  font-kerning: normal;
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
ul,
ol,
dl,
figure,
.highlight {
  margin-bottom: 1rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 1rem;
  font-weight: 400;
}

a {
  color: var(--brand-color);
  text-decoration: none;
}

a:visited {
  color: var(--brand-color);
}

a:hover {
  color: var(--text-color);
  text-decoration: underline;
}

blockquote {
  color: var(--secondary-text-color);
  font-style: italic;
  padding: 0 1rem;
  border-left: 0.5rem solid var(--dark-grey-color);
  margin: 0;
}

pre,
code,
.highlighter-rouge .highlight {
  font-family: "Fira Mono", Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

code {
  font-size: calc(1rem - 1pt);
  border: 1px solid var(--grey-color);
  border-radius: 3px;
}

code {
  padding: 1px 5px;
}

pre {
  padding: 8px 12px;
  border-radius: 0.25rem;
  overflow-x: auto;
  background-color: #121a2f;
  color: #fcfffb;
}

pre > code {
  border: 0;
  padding-right: 0;
  padding-left: 0;
}

/**********
* Header *
**********/

#site-header {
  display: flex;
  flex-direction: row;
  justify-content: center;
  margin-bottom: 1rem;
  width: 100%;

  position: sticky;
  -webkit-position: sticky;
  top: 0;

  color: var(--background-color);
  background-color: var(--brand-color);
}

#site-header > .wrapper {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex-grow: 1;

  max-width: var(--site-max-width);
  padding: 0 1rem;
}

@supports (margin-left: env(safe-area-inset-left)) {
  #site-header > .wrapper {
    padding-top: max(0, env(safe-area-inset-top));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

#site-header a {
  color: var(--background-color);
}

#site-header h1 {
  font-weight: 200;
  letter-spacing: -1px;
  font-size: 1.625rem;
  margin: 0;
  line-height: 3.5rem;
  vertical-align: baseline;
}

#site-header svg.logo {
  position: relative;
  top: 5px;
  margin-right: 8px;
  fill: var(--background-color);
}

#site-header #site-nav {
  text-align: right;
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  flex-wrap: wrap;
}

#site-header #site-nav .page-link {
  line-height: 3.5rem;
  vertical-align: middle;
}

#site-header #site-nav .page-link:not(:last-child) {
  margin-right: 2rem;
}

#site-header #site-nav .page-link svg.icon {
  fill: var(--background-color);
  position: relative;
  top: 3px;
}

@media (max-width: 32rem) {
  #site-header {
    position: static;
  }

  #site-header > .wrapper {
    flex-direction: column;
  }

  #site-header h1 {
    text-align: center;
  }

  head#site-header #site-nav {
    text-align: center;
  }

  #site-header #site-nav .page-link:not(:last-child) {
    margin-right: 1rem;
  }
}

/**********
* Footer *
**********/

#site-footer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 1rem;
  margin-top: 1rem;
  padding: 2rem 1rem 4rem;
  max-width: var(--site-max-width);
  margin: auto;

  color: var(--grey-color);
  font-size: calc(1rem - 1pt);
  line-height: 1.3rem;
}

@supports (margin-left: env(safe-area-inset-left)) {
  #site-footer {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(4rem, env(safe-area-inset-bottom));
  }
}

#site-footer ul.contact,
#site-footer ul.social-media-list {
  list-style: none;
  padding: 0;
}

#site-footer .summary {
  grid-column: 3 / 5;
}

#site-footer .social-media-list .icon {
  fill: var(--grey-color);
}

@media (max-width: 32rem) {
  #site-footer {
    grid-template-columns: repeat(2, 1fr);
  }

  #site-footer .summary {
    grid-column: 1 / 3;
  }
}

/********
* Page *
********/

#page {
  max-width: var(--site-max-width);
  margin: auto;
  padding: 1rem;
}

@supports (margin-left: env(safe-area-inset-left)) {
  #page {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

#page .page-heading {
  padding: 0 0 1rem;
  font-size: 2.5rem;
  line-height: 1em;
}

/************
* Homepage *
************/

#homepage {
  max-width: var(--site-max-width);
  margin: auto;
  padding: 5rem 1rem;
}

@supports (margin-left: env(safe-area-inset-left)) {
  #homepage {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

#homepage h2 {
  font-weight: 200;
}

#homepage > .jumbotron {
  font-size: 2.5rem;
  font-weight: 200;
  display: flex;
  flex-direction: column;
  text-align: center;
  color: var(--secondary-text-color);
}

#homepage > .jumbotron img,
#homepage > .jumbotron svg {
  margin: auto;
}

#homepage > .jumbotron > .title {
  color: var(--text-color);
}

#homepage .logo {
  fill: var(--brand-color);
}

/****************
* Blog Listing *
****************/

#blog-listing {
  max-width: var(--site-max-width);
  margin: auto;
  padding: 1rem;
}

@supports (margin-left: env(safe-area-inset-left)) {
  #blog-listing {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

#blog-listing .page-heading {
  grid-column: 1 / 5;
  font-size: 2.5rem;
  line-height: 1em;
  margin-bottom: 2rem;
}

#blog-listing .post-list {
  margin: 0;
  padding: 0;
}

#blog-listing .post-list .post {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 1rem;
}

#blog-listing .post-list .post:not(:last-child) {
  margin-bottom: 1rem;
}

#blog-listing .post-list .post .post-meta,
#blog-listing .post-list .post .post-meta time {
  grid-column: 4 / 5;
  vertical-align: middle;
  text-align: right;
  line-height: 1.5rem;

  font-size: calc(1rem - 1pt);
  color: var(--grey-color);
}

#blog-listing .post-list .post .post-title {
  grid-column: 1 / 4;
  vertical-align: baseline;
  margin: 0;
  font-size: 1.5rem;
}

@media (max-width: 32rem) {
  #blog-listing .post-list .post {
    grid-template-columns: repeat(3, 1fr);
  }

  #blog-listing .post-list .post .post-title {
    grid-column: 1 / 3;
  }

  #blog-listing .post-list .post .post-meta,
  #blog-listing .post-list .post .post-meta time {
    grid-column: 3 / 4;
  }
}

/*************
* Blog Post *
**************/

#blog-post {
  padding: 1rem;
  max-width: var(--site-max-width);
  margin: auto;
}

@supports (margin-left: env(safe-area-inset-left)) {
  #blog-post {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

#blog-post h1.post-title {
  font-size: 2.5rem;
  line-height: 1em;
}

#blog-post p.post-meta {
  color: var(--secondary-text-color);
  margin-top: 0;
  margin-bottom: 2rem;
}

/***********************
* Syntax Highlighting *
***********************/

.highlight {
  color: #fcfffb;
}
.highlight .c {
  color: #667e82;
} /* Comment */
.highlight .err {
  color: #960050;
} /* Error */
.highlight .k {
  color: #66d9ef;
} /* Keyword */
.highlight .l {
  color: #ae81ff;
} /* Literal */
.highlight .n {
  color: #fcfffb;
} /* Name */
.highlight .o {
  color: #f92672;
} /* Operator */
.highlight .p {
  color: #fcfffb;
} /* Punctuation */
.highlight .ch {
  color: #667e82;
} /* Comment.Hashbang */
.highlight .cm {
  color: #667e82;
} /* Comment.Multiline */
.highlight .cp {
  color: #667e82;
} /* Comment.Preproc */
.highlight .cpf {
  color: #667e82;
} /* Comment.PreprocFile */
.highlight .c1 {
  color: #667e82;
} /* Comment.Single */
.highlight .cs {
  color: #667e82;
} /* Comment.Special */
.highlight .gd {
  color: #f92672;
} /* Generic.Deleted */
.highlight .ge {
  font-style: italic;
} /* Generic.Emph */
.highlight .gi {
  color: #a6e22e;
} /* Generic.Inserted */
.highlight .gs {
  font-weight: bold;
} /* Generic.Strong */
.highlight .gu {
  color: #667e82;
} /* Generic.Subheading */
.highlight .kc {
  color: #66d9ef;
} /* Keyword.Constant */
.highlight .kd {
  color: #66d9ef;
} /* Keyword.Declaration */
.highlight .kn {
  color: #f92672;
} /* Keyword.Namespace */
.highlight .kp {
  color: #66d9ef;
} /* Keyword.Pseudo */
.highlight .kr {
  color: #66d9ef;
} /* Keyword.Reserved */
.highlight .kt {
  color: #66d9ef;
} /* Keyword.Type */
.highlight .ld {
  color: #e6db74;
} /* Literal.Date */
.highlight .m {
  color: #ae81ff;
} /* Literal.Number */
.highlight .s {
  color: #e6db74;
} /* Literal.String */
.highlight .na {
  color: #a6e22e;
} /* Name.Attribute */
.highlight .nb {
  color: #fcfffb;
} /* Name.Builtin */
.highlight .nc {
  color: #a6e22e;
} /* Name.Class */
.highlight .no {
  color: #66d9ef;
} /* Name.Constant */
.highlight .nd {
  color: #a6e22e;
} /* Name.Decorator */
.highlight .ni {
  color: var(--text-color);
} /* Name.Entity */
.highlight .ne {
  color: #a6e22e;
} /* Name.Exception */
.highlight .nf {
  color: #a6e22e;
} /* Name.Function */
.highlight .nl {
  color: #fcfffb;
} /* Name.Label */
.highlight .nn {
  color: #fcfffb;
} /* Name.Namespace */
.highlight .nx {
  color: #a6e22e;
} /* Name.Other */
.highlight .py {
  color: #fcfffb;
} /* Name.Property */
.highlight .nt {
  color: #f92672;
} /* Name.Tag */
.highlight .nv {
  color: #fcfffb;
} /* Name.Variable */
.highlight .ow {
  color: #f92672;
} /* Operator.Word */
.highlight .w {
  color: #fcfffb;
} /* Text.Whitespace */
.highlight .mb {
  color: #ae81ff;
} /* Literal.Number.Bin */
.highlight .mf {
  color: #ae81ff;
} /* Literal.Number.Float */
.highlight .mh {
  color: #ae81ff;
} /* Literal.Number.Hex */
.highlight .mi {
  color: #ae81ff;
} /* Literal.Number.Integer */
.highlight .mo {
  color: #ae81ff;
} /* Literal.Number.Oct */
.highlight .sa {
  color: #e6db74;
} /* Literal.String.Affix */
.highlight .sb {
  color: #e6db74;
} /* Literal.String.Backtick */
.highlight .sc {
  color: #e6db74;
} /* Literal.String.Char */
.highlight .dl {
  color: #e6db74;
} /* Literal.String.Delimiter */
.highlight .sd {
  color: #e6db74;
} /* Literal.String.Doc */
.highlight .s2 {
  color: #e6db74;
} /* Literal.String.Double */
.highlight .se {
  color: #ae81ff;
} /* Literal.String.Escape */
.highlight .sh {
  color: #e6db74;
} /* Literal.String.Heredoc */
.highlight .si {
  color: #e6db74;
} /* Literal.String.Interpol */
.highlight .sx {
  color: #e6db74;
} /* Literal.String.Other */
.highlight .sr {
  color: #e6db74;
} /* Literal.String.Regex */
.highlight .s1 {
  color: #e6db74;
} /* Literal.String.Single */
.highlight .ss {
  color: #e6db74;
} /* Literal.String.Symbol */
.highlight .bp {
  color: #fcfffb;
} /* Name.Builtin.Pseudo */
.highlight .fm {
  color: #a6e22e;
} /* Name.Function.Magic */
.highlight .vc {
  color: #fcfffb;
} /* Name.Variable.Class */
.highlight .vg {
  color: #fcfffb;
} /* Name.Variable.Global */
.highlight .vi {
  color: #fcfffb;
} /* Name.Variable.Instance */
.highlight .vm {
  color: #fcfffb;
} /* Name.Variable.Magic */
.highlight .il {
  color: #ae81ff;
} /* Literal.Number.Integer.Long */

.language-applescript .highlight code {
  font-family: var(--sans-serif-font-family);
}

.language-applescript .c1 {
  font-style: italic;
}
