/* Media Queries */

@media (min-width: 320px) {
  .mq-xs {
    content: "";
  }
}

@media (min-width: 480px) {
  .mq-sm {
    content: "";
  }
}

@media (min-width: 720px) {
  .mq-md {
    content: "";
  }
}

@media (min-width: 1000px) {
  .mq-lg {
    content: "";
  }
}

/* Variables */
:root {
  --background: #f7f7f7;
  --box-shadow: 0px 1px 22px 4px rgba(0, 0, 0, .10);
  --border: 1px solid rgba(191, 191, 191, 0.4);
  --items: 5;
  --rows: 3; /* ceil(5 / 2) */

  /* Card sizing */
  --card-height: 400px;
  --card-width: 450px;
  --inner-margin: 15px;
  --number-size: 35px;
  --stagger: 180px;
  --outer-margin: 90px;
  --marker-size: 9px;

  /* Colors */
  --color1: #0f5346;
  --timeline: #bdbdbd;

  /* Calculations */
  --container-height: calc(var(--rows) * (var(--card-height) + var(--outer-margin)) + var(--stagger));
  --container-width: calc(var(--card-width) * 2 + var(--outer-margin) * 3);
  --head-height: calc(var(--number-size) + 50);
  --body-height: calc(var(--card-height) - var(--head-height));
  --marker-dist: calc(var(--card-width) + var(--outer-margin) / 2 - var(--marker-size) / 2);
}

@media (min-width: 1000px) {
  .arrow {
    position: absolute;
    content: "";
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
  }
  .marker {
    position: absolute;
    content: "";
    width: var(--marker-size);
    height: var(--marker-size);
    background-color: var(--timeline);
    border-radius: var(--marker-size);
    box-shadow: 0px 0px 2px 8px var(--background);
  }
}

/* Some Cool Stuff */
.demo-card:nth-child(1) { order: 1; }
.demo-card:nth-child(3) { order: 2; }
.demo-card:nth-child(5) { order: 3; }
.demo-card:nth-child(2) { order: 4; }
.demo-card:nth-child(4) { order: 5; }
.demo-card:nth-child(6) { order: 6; }
.demo-card:nth-child(7) { order: 7; }
.demo-card:nth-child(8) { order: 8; }



/* Border Box */
* {
  box-sizing: border-box;
}

/* Fonts */
body {
  font-family: Roboto, sans-serif;
}

#timeline {
  padding: 100px 0;
  background: var(--background);
  border-top: var(--border);
  border-bottom: var(--border);
}



#timeline p.leader {
  text-align: center;
  max-width: 90%;
  margin: auto;
  margin-bottom: 45px;
}

#timeline .demo-card-wrapper {
  position: relative;
  margin: auto;
}

@media (min-width: 1000px) {
  #timeline .demo-card-wrapper {
    display: flex;
    flex-flow: column wrap;
    width: var(--container-width);
    height: var(--container-height);
    margin: 0 auto;
  }
  #timeline .demo-card-wrapper::after {
    z-index: 1;
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    border-left: var(--border);
    border-left: 1px solid var(--timeline);
  }
}

#timeline .demo-card {
  position: relative;
  display: block;
  margin: 10px auto 80px;
  max-width: 94%;
  z-index: 2;
}

@media (min-width: 480px) {
  #timeline .demo-card {
    max-width: 60%;
    box-shadow: var(--box-shadow);
  }
}

@media (min-width: 720px) {
  #timeline .demo-card {
    max-width: 40%;
  }
}

@media (min-width: 1000px) {
  #timeline .demo-card {
    max-width: var(--card-width);
    height: var(--card-height);
    margin: var(--outer-margin);
    margin-top: calc(var(--outer-margin) / 2);
    margin-bottom: calc(var(--outer-margin) / 2);
  }
  #timeline .demo-card:nth-child(odd) {
    margin-right: calc(var(--outer-margin) / 2);
  }
  #timeline .demo-card:nth-child(odd) .head::after {
    border-left-width: 15px;
    border-left-style: solid;
    left: 100%;
  }
  #timeline .demo-card:nth-child(odd) .head::before {
    left: calc(var(--marker-dist) + 1);
  }
  #timeline .demo-card:nth-child(even) {
    margin-left: calc(var(--outer-margin) / 2);
  }
  #timeline .demo-card:nth-child(even) .head::after {
    border-right-width: 15px;
    border-right-style: solid;
    right: 100%;
  }
  #timeline .demo-card:nth-child(even) .head::before {
    right: calc(var(--marker-dist) - 1);
  }
  #timeline .demo-card:nth-child(2) {
    margin-top: var(--stagger);
  }
}

#timeline .demo-card .head {
  position: relative;
  display: flex;
  align-items: center;
  color: #fff;
  font-weight: 400;
}

#timeline .demo-card .head .number-box {
  display: inline;
  float: left;
  margin: var(--inner-margin);
  padding: 10px;
  font-size: var(--number-size);
  line-height: var(--number-size);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.17);
}

#timeline .demo-card .head h2 {
  text-transform: uppercase;
  font-size: 1.3rem;
  font-weight: inherit;
  letter-spacing: 2px;
  margin: 0;
  padding-bottom: 6px;
  line-height: 1rem;
}

@media (min-width: 480px) {
  #timeline .demo-card .head h2 {
    font-size: 95%;
    line-height: 1.2rem;
  }
}

#timeline .demo-card .head h2 span {
  
  font-size: 1.3rem;
  margin: 0;
}

@media (min-width: 480px) {
  #timeline .demo-card .head h2 span {
    font-size: 0.8rem;
  }
}

#timeline .demo-card .body {
  background: #fff;
  border: var(--border);
  border-top: 0;
  padding: var(--inner-margin);
}

@media (min-width: 1000px) {
  #timeline .demo-card .body {
    height: var(--body-height);
  }
}

#timeline .demo-card .body p {
  font-size: 14px;
  line-height: 18px;
  margin-bottom: var(--inner-margin);
}

#timeline .demo-card .body img {
  display: block;
  width: 100%;
}

/* Colors for steps */
#timeline .demo-card--step1 {
  background-color: var(--color1);
}

#timeline .demo-card--step1 .head::after {
  border-color: var(--color1);
}

#timeline .demo-card--step2 {
  background-color: var(--color1);
}

#timeline .demo-card--step2 .head::after {
  border-color: var(--color1);
}

#timeline .demo-card--step3 {
  background-color: var(--color1);
}

#timeline .demo-card--step3 .head::after {
  border-color: var(--color1);
}

#timeline .demo-card--step4 {
  background-color: var(--color1);
}

#timeline .demo-card--step4 .head::after {
  border-color: var(--color1);
}

#timeline .demo-card--step5 {
  background-color: var(--color1);
}

#timeline .demo-card--step5 .head::after {
  border-color: var(--color1);
}

#timeline .demo-card--step6 {
  background-color: var(--color1);
}

#timeline .demo-card--step6 .head::after {
  border-color: var(--color1);
}


/*
#timeline .demo-card--step7 {
  background-color: var(--color1);
}

#timeline .demo-card--step7 .head::after {
  border-color: var(--color1);
}

#timeline .demo-card--step8 {
  background-color: var(--color1);
}

#timeline .demo-card--step8 .head::after {
  border-color: var(--color1);
}

*/
