@import url("https://fonts.googleapis.com/css?family=Montserrat:300,400");
@import url('https://fonts.googleapis.com/css?family=K2D:100,300,400');

*, ::after, ::before {
  box-sizing: border-box;
}

a:focus {
  outline: none; /* For that ugly dotted line around links in Firefox */
}

#bio p {
  line-height: 1.6em;
  max-width: 40em;
}

body {
  background-color: white;
  margin: 0;
  max-width: 100em;
}

[data-experience]::before, [data-desire]::after {
  background-image: linear-gradient(to right, rgb(230, 255, 230), rgb(165, 220, 165)), linear-gradient(to right, rgba(60, 60, 60, 0.0), rgba(188, 230, 188, 0.5));
  background-repeat: no-repeat;
  content: "";
  display: block;
  height: 100%;
  padding-right: 0.5em;
  position: absolute;
  top: 0;
}

[data-experience="4"]::before, [data-desire="4"]::after {
  background-size: 80%, 100%;
}

[data-experience="3"]::before, [data-desire="3"]::after {
  background-size: 60%, 100%;
}

[data-experience="2"]::before, [data-desire="2"]::after {
  background-size: 40%, 100%;
}

[data-experience="1"]::before, [data-desire="1"]::after {
  background-size: 20%, 100%;
}

[data-experience="0"]::before {
  background-size: 0%, 100%;
}

#education .completion {
  margin: 0.5em 0 0;
}

#education .completion, #experience .date-range .start-date, #experience .date-range .end-date {
  display: inline-block;
  font-size: 0.9em;
  text-shadow: 0 0 10px rgb(157, 215, 157);
}

#education .emphasis, #education .institution {
  flex-basis: 100%;
  line-height: 1.6em;
  margin: 0;
}

#education .institution {
  margin-top: 0.5em;
}

#education .section-content ul {
  list-style: none;
  margin: 0 0 1em;
  padding: 0;
}

#education .section-content ul li {
  align-items: baseline;
  display: flex;
  flex-flow: row wrap;
  max-width: 40em;
}

#education .title {
  margin-top: 0.5em;
}

#experience .date-range {
  flex: 1 1 auto;
  margin: 0.5em 0 0 1em;
  text-align: right;
}

#experience .date-range .end-date::before {
  content: "– ";
}

#experience .date-range .start-date, #experience .date-range .end-date {
  margin: 0;
}

#experience .description {
  flex-basis: 100%;
  line-height: 1.6em;
  margin: 0.5em 0 1em;
}

#experience .employer {
  flex-basis: 100%;
  font-size: 0.8em;
  font-weight: bold;
  margin: 0.25em 0 0;
}

#experience .section-content ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#experience .section-content ul li {
  align-items: baseline;
  display: flex;
  flex-flow: row wrap;
  max-width: 40em;
}

#external-links {
  justify-content: flex-end;
}

#external-links li {
  margin: 0 0.5em;
}

#external-links a {
  background-color: rgb(204, 243, 204);
  color: transparent;
  display: block;
  height: 35px;
}

#external-links li:first-of-type a {
  mask-image: url("github.svg");
  -webkit-mask-image: url("github.svg");
  width: 36px;
}

#external-links li:last-of-type a {
  mask-image: url("linkedin.svg");
  -webkit-mask-image: url("linkedin.svg");
  width: 46px;
}

h2, #titles {
  font-family: "K2D", sans-serif;
  font-size: 1.3rem;
  font-weight: 100;
  letter-spacing: 0.08em;
  margin: 0;
  padding: 0;
}

h3 {
  font-family: "K2D", sans-serif;
  font-size: 1.2rem;
  font-weight: 400;
}

header {
  background-color: rgb(60, 60, 60);
  display: flex;
  flex-flow: row nowrap;
  justify-content: space-between;
  left: 0;
  padding: 1.5em 1em;
  position: fixed;
  top: 0;
  transition: height 0.25s;
  width: 100%;
}

html {
  background-color: rgb(96, 121, 96);
  margin: 0;
  padding: 0;
  position: relative;
}

html, #names li .nickname {
  color: rgb(60, 60, 60);
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
}

#names {
  display: flex;
  flex-flow: row wrap;
  margin: 0;
}

#names li {
  display: inline;
  margin: 0 0.1em;
}

#names li:first-of-type {
  margin-left: 0;
}

#names li:last-of-type {
  flex-basis: 100%;
  margin-left: 0;
}

#names li:not(:last-of-type) {
  color: rgb(90, 90, 90);
  font-weight: 300;
}

#names-small {
  display: flex;
  flex-flow: row wrap;
  font-family: "Montserrat", sans-serif;
  margin: 0 -3em 0 0;
  padding: 0;
}

#names-small .nickname {
  color: rgb(204, 243, 204);
  font-weight: 400;
}

#names-small li {
  display: inline;
  margin: 0 0.1em;
}

#names-small li:first-of-type {
  margin-left: 0;
}

#names-small li:last-of-type {
  flex-basis: 100%;
  font-weight: 400;
  margin-left: 0;
}

#names-small li:not(:last-of-type) {
  color: rgb(168, 221, 168);
  font-weight: 300;
}

nav {
  flex: 1 0 auto;
}

nav > ul, #external-links {
  font-size: 1.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav > ul a, #external-links a {
  color: rgb(204, 243, 204);
  font-family: "K2D", sans-serif;
  font-weight: 300;
  text-decoration: none;
}

section {
  animation: fade-in 1s;
}

#skills .section-content ul, #technologies .section-content ul {
  line-height: 1.4em;
  list-style: none;
  margin: 0.5em 0 1em;
  padding: 0 0 0 0.5em;
}

#skills .section-content li, #technologies .section-content li {
  margin-top: 1px;
  position: relative;
}

#titles {
  list-style: none;
}

#titles li {
  font-weight: 300;
}

.fade-in {
  animation: fade-in 0.25s;
}

.fade-out {
  animation: fade-out 0.25s;
}

@keyframes fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes fade-out {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@media screen and (max-width: 511px) {
  body {
    padding: calc(1.5em * 2 + 2 * 6vw) 1em 5em;
  }

  header.expanded {
    height: calc(1.5em * 2 + 2 * 6vw);
  }

  #names {
    font-size: 7vw;
  }

  #names-small {
    font-size: 6vw;
    line-height: 6vw;
  }

  .nav-open, .nav-open.expanded {
    height: calc(1.5em * 2 + 0.75em * 2 + 2 * 6vw + 5 * 1.2rem * 1.5 + 35px);
  }

  section {
    margin-top: calc(2em - 1.5em * 2 - 2 * 6vw - 0.5em);
    padding-top: calc(1.5em * 2 + 2 * 6vw + 0.5em);
  }
}

@media screen and (min-width: 512px) and (max-width: 767px) {
  body {
    padding: calc(1.5em * 2 + 2 * 5vw) 1em 5em;
  }

  header.expanded {
    height: calc(1.5em * 2 + 2 * 5vw);
  }

  #names {
    font-size: 6vw;
  }

  #names-small {
    font-size: 5vw;
    line-height: 5vw;
  }

  .nav-open, .nav-open.expanded {
    height: calc(1.5em * 2 + 0.75em * 2 + 2 * 5vw + 5 * 1.2rem * 1.5 + 35px);
  }

  section {
    margin-top: calc(2em - 1.5em * 2 - 2 * 5vw - 0.5em);
    padding-top: calc(1.5em * 2 + 2 * 5vw + 0.5em);
  }
}

@media screen and (min-width: 768px) and (max-width: 869px) {
  body {
    padding: calc(1.5em * 2 + 2 * 4vw) 1em 5em;
  }

  header.expanded {
    height: calc(1.5em * 2 + 2 * 4vw);
  }

  #names {
    font-size: 6vw;
  }

  #names-small {
    font-size: 4vw;
    line-height: 4vw;
  }

  .nav-open, .nav-open.expanded {
    height: calc(1.5em * 2 + 0.75em * 2 + 2 * 4vw + 5 * 1.2rem * 1.5 + 35px);
  }

  section {
    margin-top: calc(2em - 1.5em * 2 - 2 * 4vw - 0.5em);
    padding-top: calc(1.5em * 2 + 2 * 4vw + 0.5em);
  }
}

@media screen and (max-width: 869px) {
  #education .completion {
    flex: 1 1 100%;
  }

  #external-links {
    display: none;
  }

  [data-experience]::before, [data-desire]::after {
    width: 100%;
    z-index: -1;
  }

  .expanded nav > ul > :first-child {
    display: block;
  }

  h3, #titles {
    margin: 0.3em 0 0;
  }

  header {
    height: calc(1.5em * 2 + 35px);
  }

  header::after {
    background-color: rgb(204, 243, 204);
    content: "";
    cursor: pointer;
    display: block;
    flex-shrink: 0;
    height: 35px;
    mask-image: url("hamburger.svg");
    -webkit-mask-image: url("hamburger.svg");
    width: 35px;
  }

  header.nav-open::after {
    grid-area: hamburger;
  }

  #names {
    display: none;
    padding-left: 0;
    padding-top: 0.5em;
  }

  nav > ul > * {
    display: none;
    margin: 0;
  }

  .nav-open {
    display: grid;
    grid-template-areas:
      "nav hamburger"
      "nav ."
      "links .";
    justify-content: space-between;
  }

  .nav-open #external-links {
    display: flex;
    grid-area: links;
    justify-content: flex-start;
    margin: 0.75em 0 0 0;
  }

  .nav-open #external-links li:first-of-type {
    margin-left: 0;
  }

  .nav-open nav {
    grid-area: nav;
  }

  .nav-open nav > ul {
    flex-flow: column nowrap;
  }

  .nav-open nav > ul a {
    line-height: 1.5em;
  }

  .nav-open nav > ul > * {
    display: block;
  }

  .nav-open nav > ul > li:first-of-type {
    margin-bottom: 0.75em;
  }

  :not(.show-desire) > ul > [data-desire]::after {
    display: none;
  }

  section:first-of-type {
    margin-top: 0.5em;
    padding-top: 0;
  }

  section > :first-child {
    border-bottom: rgb(110, 110, 110) 1px solid;
    padding-bottom: 0.3em;
  }

  .show-desire > ul > [data-experience]::before {
    display: none;
  }

  #skills h3, #technologies h3 {
    align-items: baseline;
    display: flex;
    justify-content: space-between;
  }

  #skills h3::after {
    color: rgb(170, 170, 170);
  }

  #skills h3::after, #technologies h3::after {
    content: "Experience";
    display: block;
    font-family: "Montserrat", sans-serif;
    font-size: 0.9rem;
  }

  #skills .section-content li, #technologies .section-content li {
    z-index: 0;
  }

  #technologies h3::after {
    background-color: rgb(245, 245, 245);
    border-radius: 0.5em;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
    color: rgb(100, 100, 100);
    cursor: pointer;
    padding: 0.4em;
    text-align: center;
    width: 100px;
  }

  #technologies .show-desire > h3::after {
    content: "Desire";
  }
}

@media screen and (min-width: 870px), print {
  body {
    padding: 5em 3em 8em; /* Top padding to offset the fixed header during navigation to id anchors */
  }

  [data-desire]::after {
    left: calc(150% + 1em);
  }

  [data-desire]:first-child::after {
    content: "Desire";
  }

  [data-desire]:first-child::after, [data-experience]:first-child::before {
    background-position-y: 22.4px; /* Apparently percentages are not supported here?  This should be 100% */
    color: rgb(150, 150, 150);
    height: 200%;
    text-align: right;
    top: -100%;
  }

  [data-experience]::before {
    left: 100%;
  }

  [data-experience]:first-child::before {
    content: "Experience";
  }

  #education .completion {
    flex: 1 1 auto;
    text-align: right;
  }

  #external-links a {
    transition: background-color 0.25s;
  }

  #external-links a:hover {
    background-color: white;
  }

  h3 {
    margin: 1em 0 0;
  }

  header {
    height: calc(1.5em * 2 + 1.2em * 1.25);
  }

  header.expanded {
    height: calc(1.5em * 2 + 2 * 1.2em * 1.25);
  }

  #names {
    font-size: 2.5rem;
    order: 1;
    padding: 0.5em 0;
  }

  #names-small {
    font-size: 1.5rem;
  }

  nav > ul, #external-links {
    display: flex;
    flex-flow: row nowrap;
  }

  nav > ul a, #external-links a {
    line-height: 1.25em;
  }

  nav > ul a, #names-small .nickname {
    transition: color 0.25s;
  }

  nav > ul a:hover, #names-small:hover .nickname {
    color: white;
  }

  nav > ul > li {
    margin: 0 1em;
  }

  section {
    align-items: baseline;
    display: flex;
    flex-flow: row nowrap;
    margin-top: calc(3em - 7em); /* To offset the fixed header during navigation to id anchors */
    padding-top: 7em;            /**/
  }

  section:first-of-type {
    margin-top: 0;
    padding-top: 0;
  }

  section > :first-child, #name > :nth-child(2) {
    border: 0;
    flex-basis: 30%;
    padding-right: 2rem;
    text-align: right;
  }

  section > :not(:first-child), #name > :first-child {
    border-left: rgb(110, 110, 110) 1px solid;
    flex-basis: 70%;
    padding-left: 2rem;
    text-align: left;
  }

  #skills [data-experience]::before {
    width: 16.5em;
  }

  #skills .section-content li, #technologies .section-content li {
    width: 16.5em;
  }

  #technologies [data-experience]::before, #technologies [data-desire]::after {
    width: 7.5em;
  }
}

/* Header horizontal collapse on medium-width layouts */
@media screen and (min-width: 870px) and (max-width: 1023px) {
  #external-links {
    padding: 0.75em 0.5em 0 0;
    position: absolute;
    right: 0;
    top: 0;
  }

  header.expanded {
    height: calc(1.5em * 2 + 2 * 1.2em * 1.25 + 1em);
  }

  nav {
    position: relative;
  }

  nav > ul {
    align-items: flex-end;
    bottom: 0;
    position: absolute;
  }
}

@media screen and (min-width: 1024px) {
  nav > ul, #external-links {
    align-items: center;
  }
}

/* Backdrop and drop shadow on wide layouts */
@media screen and (min-width: 1280px) {
  body {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    margin: 0 auto;
    width: 75%;
  }
}

@media only print {
  #bio {
    grid-area: bio;
    width: 28.5em;
  }

  #bio p {
    line-height: 1.125em;
    margin: 0.25em 0 0;
  }

  body {
    display: grid;
    grid-template-areas:
      "name name"
      "skills experience"
      "technologies experience"
      "technologies education"
      "bio education";
    grid-template-columns: 50% 50%;
    grid-template-rows: auto auto auto 1.5771in auto;
    padding: 0;
  }

  #contact-info {
    border-left: none;
    font-size: 0.85em;
    grid-area: contact-info;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  [data-desire]::after {
    left: calc(100% + 5.75em + 0.5em);
    padding-right: 0;
  }

  [data-desire]:first-child::after, [data-experience]:first-child::before {
    background-position-y: 16px;
  }

  #education {
    grid-area: education;
  }

  #experience {
    grid-area: experience;
  }

  #experience .description {
    margin-bottom: 0.5em;
  }

  #experience .section-content ul li:nth-of-type(1n+5) {
    display: none;
  }

  #experience .title {
    margin-top: 0.5em;
  }

  h2, #titles {
    font-size: 1.1rem;
  }

  header {
    display: none;
  }

  html {
    background-color: initial;
    font-size: 70%;
  }

  #name {
    align-items: start;
    display: grid;
    grid-area: name;
    grid-template-areas:
      "names titles"
      "names contact-info";
    grid-template-columns: 50% 50%;
    margin-bottom: 1em;
  }

  #name > :first-child {
    border-left: none;
    padding: 0;
  }

  #names {
    font-size: 2rem;
    grid-area: names;
  }

  section {
    margin-top: 0;
    padding-top: 0;
  }

  section:not(:first-of-type) {
    flex-flow: column nowrap;
  }

  section:not(:first-of-type) > :first-child {
    flex-basis: auto;
  }

  .section-content {
    border-left: none !important;
    border-top: rgb(110, 110, 110) 1px solid;
    padding: 0 !important;
  }

  #skills {
    grid-area: skills;
  }

  #skills [data-experience]::before {
    width: 12em;
  }

  #skills .section-content, #technologies .section-content {
    margin-right: -12em;
    padding-right: 12em !important;
  }

  #skills .section-content li, #technologies .section-content li {
    width: 16em;
  }

  #technologies {
    grid-area: technologies;
  }

  #technologies [data-experience]::before, #technologies [data-desire]::after {
    width: 5.75em;
  }

  #titles {
    grid-area: titles;
    text-align: left !important;
  }
}
