.theme(0) {
  @divider: #eee;
  @whitish: #fdfdfd;
  @medium: #ddd;
  @background: #fff;
  @light: #fafafa;
  @textColor: #222;
  @linkColor: #888;
}

.theme(1) {
  @divider: #222;
  @whitish: #121212;
  @medium: #444;
  @background: #111;
  @light: #0A0A0A;
  @textColor: #eee;
  @linkColor: #888;
}

.theme(@theme);

.bigFont {
  font-family: 'Coustard', serif;
}

.textFont {
  font-family: 'Lora', serif;
}

* {
  margin: 0;
  padding: 0;
  border: 0;
  font-weight: normal;
  text-decoration: none;
  list-style-type: none;
  color: inherit;
  transition: background-color 0.4s;
}

b {
  .textFont;
  font-weight: bold;
}

body {
  background-color: @background;
  min-width: @width * 1.1;
  color: @textColor;
  font-size: 20px;
  .textFont;
}

h1, h2, h3, h4, h5, h6 {
  .bigFont;
}

h1 {
  font-size: 40px;
  text-align: center;
  padding: 40px 0px;
}

h2 {
  width: @width;
  font-variant: small-caps;
  font-size: 36px;
  text-align: center;
  margin: 0px auto 10px;
}

h3 {
  width: @width;
  font-size: 30px;
  margin: 40px auto 0px;
}

h4 {
  width: @width;
  font-size: 24px;
  margin: 30px auto 0px;
}

hc1, hc2, hc3, hc4, hc5, hc6 {
  width: @width;
  display: block;
  .bigFont;
  cursor: default;
  text-align: center;
  margin: 0px auto;
}

hc1 {
  font-size: 36px;
}

hc2 {
  font-size: 25px;
}

hc3 {
  font-size: 19px;
}

fold {
  display: block;
  margin-bottom: 20px;
}

fold + h4 {
  margin: 10px auto 0px;
}

a {
  font-style: italic;
  cursor: pointer;
  h1, h2, h3, h4, h5, h6 {
    cursor: pointer;
  }
}

p, ul, dl, img, dl {
  width: @width;
  display: block;
  margin: 10px auto;
}

ul {
  li {
    list-style-type: disc;
    padding-left: 5px;
    margin-left: 25px;
  }
}

p a {
  border-bottom: solid 1px @linkColor;
}

img {
  width: auto;
  max-width: @width;
}

dl {
  display: grid;
  background-color: @divider;
  margin-bottom: 0px;
  grid-gap: 1px 0px;
  grid-template-columns: max-content auto;
  dt, dd {
    background-color: @background;
    padding: 0.4em 0px;
  }
  dt {
    grid-column-start: 1;
    padding-right: 0.6em;
  }
  dd {
    grid-column-start: 2;
  }
}

dl.experience {
  background-color: @background;
  grid-template-columns: auto;
  dt, dd {
    padding: 10px 0px;
  }
  dt {
    padding-top: 15px;
    font-size: 60px;
    padding-right: 20px;
    text-align: right;
  }
  dd {
    b {
      margin-top: -5px;
      display: block;
      font-size: 43px;
    }
  }
}

p {
  line-height: 1.4;
  overflow: hidden;
}

.toggler {
  cursor: pointer;
  &::before {
    font-size: 0.9em;
    vertical-align: text-top;
    display: inline-block;
    content: "△";
    transition: 0.4s;
    margin-right: 0.6em;
  }
  &.opened::before {
    transform: rotate(180deg);
  }
}

pre {
  box-sizing: border-box;
  width: @width;
  max-height: 400px;
  font-size: 16px;
  margin: 20px auto 30px !important;
  overflow: auto !important;
  .scrollbars;
  code {
    letter-spacing: inherit;
  }
}

code {
  color: @textColor;
  background: @divider;
  font-weight: normal;
  letter-spacing: 0.02em;
  padding: 0.0em 0.1em;
  border-radius: 5px;
}

#menu {
  margin-bottom: 60px;
  text-align: center;
  border-style: solid none;
  border-color: @divider;
  background-color: @whitish;
  border-width: 1px;
  font-size: 20px;
  li {
    margin: 5px 25px;
    display: inline-block;
    a {
      color: @linkColor;
      font-style: normal;
    }
    .active {
      color: @textColor;
    }
  }
}

#content {
  display: block;
  padding-bottom: 48px;
}

#footer {
  background: @light;
  text-align: center;
  position: fixed;
  bottom: 0px;
  left: 0px;
  right: 0px;
  letter-spacing: 2px;
  font-size: 17px;
  border-top: solid 1px @divider;

  a {
    font-style: normal;
    padding: 10px 0px;
    display: inline-block;
  }
}

.category {
  margin: 20px auto 0px !important;
  li {
    width: @width;
    margin-left: 0px;
    display: block;
    border-bottom: dashed @linkColor 1px;
    padding-bottom: 12px;
    margin-bottom: 15px;
    &:last-of-type {
      border: none;
    }
    h2 {
      .bigFont;
      display: inline-block;
      text-align: left;
      font-variant: normal;
      font-size: 1.1em;
      width: @width - 220px;
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
      padding: 0px;
      margin: 0px;
      vertical-align: text-bottom;
    }
    p.job {
      font-style: italic;
      width: @width - 220px;
    }
    p {
      display: inline-block;
      width: @width - 120px;
      margin: 0px;
    }
    .postInfo, .duration {
      letter-spacing: normal;
      display: inline-block;
      width: 220px;
      text-align: right;
      margin: 0px;
      padding: 0px;
      vertical-align: text-top;
    }
    .duration {
      vertical-align: top;
      font-style: italic;
    }
  }
}

.postPreview {
  padding-bottom: 50px;
  .readMore {
    position: relative;
    width: 300px;
    margin: 0 auto;
    padding: 10px 0px;
    letter-spacing: 2px;
    font-size: 0.9em;
    display: block;
    border-bottom: solid 1px @divider;
    color: @linkColor;
    text-align: center;
  }
  h2 {
    font-variant: normal;
  }
}

.postInfo {
  letter-spacing: 2px;
  text-align: center;
  font-size: 0.9em;
  padding-bottom: 40px;
  a {
    border-bottom: dotted @linkColor 1px;
  }
}

.postPreview .postInfo {
  padding-bottom: 30px;
}

.titleImg {
  border: 1px solid @medium;
  border-radius: 5px;
  max-width: @width * 0.8;
  background-color: @divider;
  margin-bottom: 15px;
  padding: 5px;
}

.screenshot {
  max-width: @width * 0.5;
  transition: max-width 0.4s;
  &:hover {
    max-width: @width * 0.8;
  }
}

.dropcap {
  &:first-letter {
    font-size: 2.8em;
    font-weight: bold;
    line-height: 1;
    float: left;
    padding-right: 8px;
  }
}

.clickable {
  cursor: pointer;
}

.scrollbars {
  &::-webkit-scrollbar, &::-webkit-scrollbar-thumb, &::-webkit-scrollbar-button {
    border: 1px solid #222;
    &:horizontal {
      border-width: 2px 0px;
    }
    &:vertical {
      border-width: 0px 2px;
    }
  }
  &::-webkit-scrollbar {
    border-radius: 5px;
    width: 14px;
    height: 14px;
    background-color: #444;
    border: 1px solid #222;
  }

  &::-webkit-scrollbar-thumb {
    background-color: #777;
  }

  &::-webkit-scrollbar-corner {
    border-radius: 5px;
  }

  &::-webkit-scrollbar-button {
    width: 12px;
    height: 12px;
    background-color: #999;
    border: solid 0px #222;
    &:horizontal:increment {
      border-radius: 0px 6px 6px 0px;
    }
    &:horizontal:decrement {
      width: 14px;
      border-left-width: 2px;
      border-radius: 6px 0px 0px 6px;
    }
    &:vertical:increment {
      border-radius: 0px 0px 6px 6px;
    }
    &:vertical:decrement {
      height: 14px;
      border-top-width: 2px;
      border-radius: 6px 6px 0px 0px;
    }
  }
}