:root {
  --pad: clamp(1.25rem, 3vw, 3rem);
  color-scheme: dark;
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  color: #e9eadf;
  background: #121310;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

main {
  isolation: isolate;
  display: grid;
  height: 100dvh;
  min-height: 100dvh;
  grid-template-rows: auto auto 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: var(--pad);
  overflow: hidden;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

header p {
  margin: 0;
  color: #a8f0c6;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

header a {
  color: rgb(233 234 223 / 32%);
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-decoration: none;
}

header a:hover,
header a:focus-visible {
  color: rgb(233 234 223 / 72%);
}

.sentence {
  display: flex;
  min-height: clamp(8rem, 22vw, 19rem);
  align-items: center;
}

h1 {
  max-width: 22ch;
  margin: 0;
  font-size: clamp(2rem, 5.7vw, 6.5rem);
  font-weight: 450;
  letter-spacing: -0.065em;
  text-wrap: balance;
}

#metric {
  padding: 0;
  border: 0;
  border-bottom: 0.08em solid #a8f0c6;
  color: #a8f0c6;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

#metric:focus-visible,
a:focus-visible {
  outline: 2px solid #a8f0c6;
  outline-offset: 0.3rem;
}

.caret {
  display: inline-block;
  width: 0.08em;
  height: 0.78em;
  translate: 0 0.08em;
  background: #a8f0c6;
  animation: blink 0.9s step-end infinite;
}

.complete .caret {
  opacity: 0;
  animation: none;
}

.chart {
  position: relative;
  margin: 0 calc(var(--pad) * -1) calc(var(--pad) * -1);
}

canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes blink {
  50% { opacity: 0; }
}

@media (max-width: 40rem) {
  main {
    gap: 1.5rem;
  }

  header p {
    font-size: 1rem;
  }

  h1 {
    font-size: clamp(2rem, 10.5vw, 3.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .caret {
    animation: none;
  }
}
