:root {
  --columns-per-row: 16;
  --color-background: #fff;
  --color-dark-gray: #333;
  --color-dark-gray-filled: #888;
  --color-black: #000;
  --color-white: #fff;
  --rect-gap: 6px;
  --week-gap: 2px;
  --week-size: 4px;
  --month-gap: 10px;

  /* Do not change these */
  --month-cell-width: calc(calc(calc(var(--week-size) * 4) + calc(var(--week-gap) * 4) * 4));
  --calendar-width: calc(calc(var(--month-cell-width) * var(--columns-per-row)) - calc(var(--month-cell-width) * 3));
}

.calendar {
  display: grid;
  grid-gap: var(--month-gap);
  grid-template-columns: repeat(var(--columns-per-row), auto);
  padding-top: 60px;
  width: 100%;
}

body {
  background-color: var(--color-background);
  font-family: Inter, sans-serif;
  margin: 0;
  padding: 0;
}

@page  {
  size: a4 portrait;
}

@media print {
  .week-cell {
    -webkit-print-color-adjust: exact;
  }
}

.title {
  color: var(--color-dark-gray);
  font-size: 50px;
  font-weight: 700;
  margin: 60px 0;
  text-align: center;
}

.wrapper,
.quote {
  font-size: 12px;
  margin: 60px auto;
  max-width: var(--calendar-width);
  padding: 0 2rem;
  width: calc(100% - 4rem);
}

.stats.wrapper {
  margin-bottom: 0;
  margin-top: 0;
  opacity: .7;
  padding: 0;
  text-align: right;
  transform: translateX(5px);
}

@media (max-width: 660px) {
  .stats.wrapper {
    max-width: 80%;
    text-align: center;
    transform: none;
  }
}

@media screen {
  .calendar {
    justify-content: center;
    margin: auto;
  }
}

.week-cell {
  align-items: center;
  border: 1px solid var(--color-dark-gray);
  display: inline-flex;
  height: var(--week-size);
  justify-content: center;
  width: var(--week-size);
}

.week-cell.filled {
  /* stylelint-disable-next-line */
  background-color: var(--color-dark-gray-filled);
  /* stylelint-disable-next-line */
  border-color: var(--color-dark-gray-filled);
}

@keyframes pulse {
  0% {
    border-radius: 0;
    box-shadow: 0 0 0 0 currentColor;
    font-size: 7px;
  }

  50% {
    border-radius: 25%;
    box-shadow: 0 0 0 3px currentColor;
    font-size: 15px;
  }

  100% {
    border-radius: 0;
    box-shadow: 0 0 0 0 currentColor;
    font-size: 7px;
  }
}

.week-cell.has-tooltip {
  /* animation: pulse 2s infinite; */
  border-color: currentColor;
  border-radius: 0;
  font-size: 7px;
  position: relative;
}

.week-cell:not(.filled) {
  opacity: .8;
}

.week-cell.invisible,
.invisible {
  /* stylelint-disable-next-line */
  background-color: var(--color-background) !important;
  /* stylelint-disable-next-line */
  border: 1px solid var(--color-background) !important;
}

.year-cell {
  display: grid;
  gap: var(--week-gap);
}

.year-wrapper {
  position: relative;
  z-index: 0;
}

.year-wrapper:hover {
  z-index: 99999999;
}

.month-cell {
  display: grid;
  gap: var(--week-gap);
  grid-template-columns: repeat(4, calc(var(--week-size) + var(--week-gap)));
  max-width: var(--month-cell-width);
  transition: all 150ms;
}

.year-label {
  font-size: 12px;
  font-weight: 400;
  margin-bottom: 4px;
  margin-top: 0;
  text-align: center;
}

/* Tooltips */
[data-tooltip] {
  cursor: default;
  position: relative;
}

[data-tooltip]:hover {
  cursor: help;
}

[data-tooltip]:hover::before {
  animation: fade-in 150ms ease;
  background-color: var(--color-black);
  border-radius: 4px;
  bottom: calc(100% + 10px);
  color: var(--color-white);
  content: attr(data-tooltip);
  display: block;
  font-size: 12px;
  left: 50%;
  max-width: 170px;
  min-width: 60px;
  padding: 6px;
  position: absolute;
  text-align: center;
  transform: translate(-50%);
  width: max-content;
  z-index: 20000;
}

[data-tooltip]:hover::after {
  animation: fade-in 150ms ease;
  border: 1px solid var(--color-black);
  border-color: var(--color-black) transparent transparent;
  border-width: 4px 6px 0;
  bottom: calc(100% + 6px);
  content: "";
  display: block;
  height: 0;
  left: 50%;
  margin-left: -6px;
  position: absolute;
  width: 0;
  z-index: 1;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Mobile responsiveness */
@media (max-width: 740px) {
  .calendar {
    grid-template-columns: repeat(16, auto);
  }
}

@media (max-width: 660px) {
  .calendar {
    grid-template-columns: repeat(12, auto);
  }
}

@media (max-width: 500px) {
  .calendar {
    grid-template-columns: repeat(10, auto);
  }
}

@media (max-width: 430px) {
  .calendar {
    grid-template-columns: repeat(8, auto);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-dark-gray: #c9d1d9;
    --color-dark-gray-filled: #c9d1d9;
    --color-background: #0d1117;
  }

  body {
    background-color: var(--color-background);
    color: #c9d1d9;
  }
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  /* stylelint-disable-next-line */
  word-wrap: normal !important;
}

.github-link-wrapper {
  margin: 0 auto 60px;
  max-width: var(--calendar-width);
  padding: 0 2rem;
  width: calc(100% - 4rem);
}

.github-link-wrapper a {
  align-items: center;
  color: var(--color-white);
  display: inline-flex;
  font-size: 12px;
  gap: .6rem;
  text-decoration: none;
}
