@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap");

:root {
  --basis: 0.64;
}

.timeline * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

.timeline {
  color: Indigo;
  font-family: "Inter", sans-serif;
  font-size: calc(var(--basis) * 25px);
  line-height: 2;
  margin: calc(var(--basis) * 50px) 0;
  max-width: 100%;
  overflow-x: auto;
}

/* Legend */

.timeline .legend {
  border: calc(var(--basis) * 2.5px) solid Indigo;
  border-radius: calc(var(--basis) * 12.5px);
  display: flex;
  gap: calc(var(--basis) * 25px);
  min-width: fit-content;
  padding: calc(var(--basis) * 25px);
  width: fit-content;
}

.timeline .legend > div {
  align-items: center;
  display: flex;
  gap: calc(var(--basis) * 25px);
}

.timeline .legend > div span {
  white-space: nowrap;
}

/* Blocks */

.timeline .block {
  align-items: end;
  background: Lavender;
  border-radius: calc(var(--basis) * 12.5px);
  display: flex;
  flex-shrink: 0;
  height: calc(var(--basis) * 50px);
  justify-content: center;
  position: relative;
  text-decoration: none;
  width: calc(var(--basis) * 50px);
}

.timeline .block[data-class="Yes"] {
  background: #be9edf; /* Tint variation of RebeccaPurple */
}

.timeline .block[data-class="No"] {
  background: Transparent;
  border: calc(var(--basis) * 2.5px) dashed Indigo;
}

.timeline .block[data-event="Presentation"] {
  background: Turquoise;
}

.timeline .block[data-event="Final Exam"] {
  background: Tomato;
}

.timeline .block[data-event="Inspiration"] .icon,
.timeline .block[data-event="Debug"] .icon {
  align-items: center;
  bottom: 0;
  color: inherit;
  display: flex;
  justify-content: center;
  left: 0;
  position: absolute;
  right: 0;
  text-decoration: none;
  top: 0;
}

.timeline .block[data-event="Inspiration"] .icon::before {
  content: "💡";
}

.timeline .block[data-event="Debug"] .icon::before {
  content: "🐞";
}

.timeline .block[data-day]:hover,
.timeline .block[data-day]:focus {
  box-shadow: 0 0 0 calc(var(--basis) * 5px) DeepPink;
  cursor: pointer;
  outline: none;
  position: relative;
  z-index: 999;
}

.timeline .block[data-day]::before {
  background: DeepPink;
  border-radius: calc(var(--basis) * 12.5px);
  bottom: calc(var(--basis) * 62.5px);
  color: GhostWhite;
  content: attr(data-day);
  display: flex;
  opacity: 0;
  padding: calc(var(--basis) * 12.5px) calc(var(--basis) * 25px);
  pointer-events: none;
  position: relative;
  transform: translateY(calc(var(--basis) * 12.5px));
  transition: all 0.4s;
  white-space: nowrap;
  width: fit-content;
}

.timeline .block[data-day]:hover::before,
.timeline .block[data-day]:focus::before {
  opacity: 1;
  transform: translateY(0);
}

/* Today */

@keyframes bounce {
  0% {
    transform: translateY(-100%);
  }

  50% {
    transform: translateY(-125%);
  }

  100% {
    transform: translateY(-100%);
  }
}

.block[data-today="Yes"]::after {
  animation: bounce 1s infinite;
  color: DeepPink;
  content: "⬇";
  display: flex;
  font-family: "Segoe UI Symbol", monospace;
  left: auto;
  pointer-events: none;
  position: absolute;
  right: auto;
  top: 0;
  transform: translateY(-100%);
  transition: opacity 0.4s;
}

.block:hover::after {
  opacity: 0;
}

/* Chart */

.timeline .rows {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: calc(var(--basis) * 25px);
  margin: calc(var(--basis) * 50px) 0;
  min-width: 50%;
  padding: calc(var(--basis) * 50px) 0 0;
  /* width: fit-content; */
  width: 100%;
}

.timeline .row {
  align-items: center;
  border-bottom: calc(var(--basis) * 2.5px) solid Lavender;
  display: flex;
  padding-bottom: calc(var(--basis) * 25px);
}

.timeline .row .info {
  flex-shrink: 0;
  padding: 0;
  padding-right: calc(var(--basis) * 25px);
  /* width: calc(var(--basis) * 500px); */
  width: calc(50% - calc(var(--basis) * 25px));
}

.timeline .row .info p {
  line-height: 1.5;
  margin: 0;
  text-wrap: balance;
}

.timeline .row .info p:first-child {
  font-weight: bold;
}

.timeline .blocks {
  display: flex;
  gap: calc(var(--basis) * 2.5px);
  width: fit-content;
}

/* Table */

.table td:first-child {
  white-space: nowrap;
}

.table td p:last-child {
  margin-bottom: 0;
}

.table tr {
  box-shadow: inset 0 0 0 0 DeepPink;
  transition: box-shadow 0.4s;
}

.table tr.highlighted {
  box-shadow: inset 0 0 0 4px DeepPink;
  position: relative;
}

/* Loading Spinner */

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.timeline:empty,
.table[data-step="1"]:empty {
  display: flex;
  justify-content: center;
}

.timeline:empty::before,
.table[data-step="1"]:empty::before {
  animation: spin 0.5s linear infinite;
  aspect-ratio: 1;
  border: 4px solid Lavender;
  border-radius: 50%;
  border-top: 4px solid DeepPink;
  content: "";
  display: flex;
  width: 24px;
}

/* Thumbnail */

.thumbnail {
  aspect-ratio: 4/1;
  border-radius: 8px;
  margin-top: 0.25em;
  object-fit: cover;
}

/* Responsive */

@media (max-width: 800px) {
  :root {
    --basis: 0.5;
  }
}

@media (max-width: 600px) {
  .timeline .row {
    align-items: flex-start;
    flex-direction: column;
  }

  .timeline .row .info {
    padding: 0 0 calc(var(--basis) * 25px) 0;
    width: 100%;
  }

  .timeline .block {
    height: calc(var(--basis) * 33.333px);
    pointer-events: none;
    width: calc(var(--basis) * 33.333px);
  }

  .timeline .block::after {
    display: none;
  }

  .timeline .legend {
    flex-wrap: wrap;
  }
}

/* Print (save as PDF) */

.print-only {
  display: none;
}

@media print {
  .print-only {
    display: block;
  }

  .screen-only {
    display: none;
  }
}
