* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  margin: 0;
  padding: 0;
  color: var(--color-text-dark);

  background-image: url("img/background.png");
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.9),
      rgba(255, 255, 255, 0.8)
    ),
    url("img/background.png");
  background-size: auto, 800px 800px;
  background-repeat: repeat, repeat;
  background-attachment: fixed;
}

#age-counter {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--color-text-leader);
  margin: -10px auto 25px auto;
  padding: 8px 15px;
  background-color: rgba(255, 255, 255, 0.7);
  display: table;
  border-radius: var(--card-border-radius);
  box-shadow: 0 1px 3px var(--color-shadow);
  transition: all 0.3s ease;
}

#age-counter:hover {
  cursor: default;
  transform: scale(1.03);
  box-shadow: 0 2px 5px var(--color-shadow);
}

#timeline {
  padding: 50px 0;
  border-top: 1px solid var(--color-line-light);
  border-bottom: 1px solid var(--color-line-light);
}

#timeline h1 {
  font-family: var(--font-title);
  text-align: center;
  font-size: 3rem;
  font-weight: 500;
  margin: 0 0 20px 0;
}

#timeline h3 {
  font-family: var(--font-title);
  text-align: center;
  font-size: 2rem;
  font-weight: 500;
  margin: 0;
}

#timeline p.leader {
  text-align: center;
  max-width: 90%;
  margin: auto;
  margin-bottom: 45px;
  font-size: 20px;
  color: var(--color-text-leader);
}

#timeline p.leader img {
  width: 50px;
}

.timeline-loader {
  text-align: center;
  padding: 20px;
  font-weight: 600;
  color: var(--color-loader);
  min-height: 50px;
}

.timeline-loader img {
  width: 50px;
}

#timeline .story-card-wrapper {
  position: relative;
  margin: auto;
}

#timeline .story-card-wrapper::after {
  z-index: 1;
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 1px solid var(--color-line-light);
  transform: translateX(-50%);
}

#timeline .story-card {
  position: relative;
  display: block;
  margin: 10px auto 80px;
  max-width: 94%;
  z-index: 2;
  border-radius: var(--card-border-radius);
}

#timeline .story-card .head {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--color-text-light);
  font-weight: 400;
  min-height: 85px;
  z-index: 2;
  border-top-left-radius: var(--card-border-radius);
  border-top-right-radius: var(--card-border-radius);
}

#timeline .story-card .head .number-box {
  margin: 15px;
  padding: 10px;
  font-size: 35px;
  line-height: 35px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.17);
  border-radius: var(--card-border-radius);
}

#timeline .story-card .head h2 {
  text-transform: uppercase;
  font-size: 1.3rem;
  font-weight: inherit;
  letter-spacing: 2px;
  margin: 0;
  padding-bottom: 6px;
  line-height: 2rem;
}

#timeline .story-card .head h2 span {
  display: block;
  font-size: 0.6rem;
  margin: 0;
  text-transform: none;
  letter-spacing: 0.5px;
}

#timeline .story-card .body {
  background: var(--color-card-bg);
  border: 1px solid var(--color-line-light);
  border-top: 0;
  padding: 15px;
  border-bottom-left-radius: var(--card-border-radius);
  border-bottom-right-radius: var(--card-border-radius);
  overflow: hidden;
}

#timeline .story-card .body p {
  font-size: 14px;
  line-height: 18px;
  margin-bottom: 15px;
  margin-top: 0;
}

#timeline .story-card .body img {
  display: block;
  width: 100%;
  background-color: #eee;
  aspect-ratio: 200 / 140;
  object-fit: cover;
}

#timeline .story-card.color-1 .head {
  background-color: var(--color-1);
  --arrow-color: var(--color-1);
}

#timeline .story-card.color-2 .head {
  background-color: var(--color-2);
  --arrow-color: var(--color-2);
}

#timeline .story-card.color-3 .head {
  background-color: var(--color-3);
  --arrow-color: var(--color-3);
}

#timeline .story-card.color-4 .head {
  background-color: var(--color-4);
  --arrow-color: var(--color-4);
}

#timeline .story-card.color-5 .head {
  background-color: var(--color-5);
  --arrow-color: var(--color-5);
}

#timeline .story-card.color-6 .head {
  background-color: var(--color-6);
  --arrow-color: var(--color-6);
}

#timeline .story-card.color-7 .head {
  background-color: var(--color-7);
  --arrow-color: var(--color-7);
}

#timeline .story-card.color-8 .head {
  background-color: var(--color-8);
  --arrow-color: var(--color-8);
}

#timeline .story-card.color-9 .head {
  background-color: var(--color-9);
  --arrow-color: var(--color-9);
}

#timeline .story-card.color-10 .head {
  background-color: var(--color-10);
  --arrow-color: var(--color-10);
}

@media (min-width: 480px) {
  #timeline .story-card {
    max-width: 60%;
    box-shadow: 0px 1px 22px 4px var(--color-shadow);
  }

  #timeline .story-card .head h2 {
    font-size: 165%;
    line-height: 2rem;
  }

  #timeline .story-card .head h2 span {
    font-size: 0.8rem;
  }
}

@media (min-width: 720px) {
  #timeline .story-card {
    max-width: 40%;
  }
}

@media (min-width: 1000px) {
  #timeline .story-card-wrapper {
    width: 1170px;
    margin: 0 auto;
  }

  #timeline .story-card-wrapper::after {
    border-left-color: var(--color-line);
  }

  #timeline .story-card {
    max-width: 450px;
  }

  #timeline .story-card:nth-child(odd) {
    margin: 45px auto 45px 90px;
  }

  #timeline .story-card:nth-child(even) {
    margin: 50px 90px 45px auto;
  }

  #timeline .story-card .head::after {
    position: absolute;
    content: "";
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
  }

  #timeline .story-card .head::before {
    position: absolute;
    content: "";
    width: 9px;
    height: 9px;
    background-color: var(--marker-dot-bg);
    border-radius: 50%;
    border: 8px solid var(--color-bg);
    box-sizing: content-box;
  }

  #timeline .story-card:nth-child(odd) .head::after {
    border-left: 15px solid var(--arrow-color);
    left: 100%;
  }

  #timeline .story-card:nth-child(odd) .head::before {
    left: calc(100% + 45px - 12.5px);
  }

  #timeline .story-card:nth-child(even) .head::after {
    border-right: 15px solid var(--arrow-color);
    right: 100%;
  }

  #timeline .story-card:nth-child(even) .head::before {
    right: calc(100% + 45px - 12.5px);
  }
}
