:root {
  --color-accent: oklch(55% 90% 5);
  accent-color: var(--color-accent);
  color-scheme: light dark;
}
body {
    /* Set line height to 1.5 times the font size
         and use the OS’s UI font as the website font
       */
    font: 100%/1.5 system-ui;
    max-width: 100ch;
    margin-inline: auto;
    padding: 5ch;
    accent-color: var(--color-accent);
  }
nav {
  --border-color: oklch(80% 3% 200/40%);
  display: flex;
  border-bottom-width: 1px;
  border-bottom-style: solid;
  border-bottom-color: var(--border-color);
}
a {
  flex: 1;
  text-decoration: none;
  color:inherit;
  text-align: center;
  padding: 0.5em;
  margin-bottom: 1ch;
}
nav a:hover {
  text-decoration: underline;
  border-bottom: 2px solid var(--color-accent);
  background-color: color-mix(in oklch,  var(--color-accent), canvas 85%);
  margin-bottom: 0ch;
}
a.current {
  border-bottom-width: .4em;
  border-bottom-style: solid;
  border-bottom-color: oklch(40% 40% 600);
  margin-bottom: 0ch;
}

.color-scheme {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 80%;
  font-family: inherit;
  background: none;
  color: inherit;
}

.color-scheme select {
  font-family: inherit;
  font-size: 100%;
  background: canvas;
  color: canvastext;
  border: 1px solid var(--border-color, currentColor);
  border-radius: 4px;
  padding: 0.25rem;
}
#profile-stats {
  background-color: #f8f8f8;
  border: 1px solid #ddd;
  padding: 1rem;
  border-radius: 8px;
  margin: 2rem 0;
}

#profile-stats h2 {
  margin-bottom: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 equal columns */
  gap: 1rem;
  text-align: center;
}

.stats-grid dt {
  font-weight: bold;
  grid-row: 1;
}

.stats-grid dd {
  margin: 0;
  grid-row: 2;
}
.stats {
  background-color: #f8f8f8;
  border: 1px solid #ddd;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap; /* allows wrapping on smaller screens */
  gap: 2rem;
}

.stats dl {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
}

.stats dt {
  font-weight: 600;
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.25rem;
}

.stats dd {
  margin: 0;
  font-size: 1.25rem;
  font-weight: bold;
  color: #222;
}
.gridlines line {
  stroke: #ccc;
  stroke-opacity: 0.5;
  shape-rendering: crispEdges;
}
dl.info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 1rem;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  border: 1px solid #ccc;
  position: fixed;
  top: 1em;
  left: 1em;
  z-index: 1000;
  transition-duration: 500ms;
  transition-property: opacity, visibility;
}

dl.info[hidden] {
  opacity: 0;
  visibility: hidden;
}

.tooltip {
  pointer-events: none;
}

circle {
  transition: 200ms;
  transform-origin: center;
  transform-box: fill-box;
  transition: all 200ms ease, r calc(var(--r) * 100ms);
  @starting-style {r: 0;}
}

circle:hover {
  transform: scale(1.5);
}
@keyframes marching-ants {
  to {
    stroke-dashoffset: -8;
  }
}

.selection {
  fill-opacity: 0.1;
  stroke: black;
  stroke-opacity: 0.7;
  stroke-dasharray: 5 3;
  animation: marching-ants 2s linear infinite;
}

circle.selected {
  fill: #ff6b6b;
}
#files {
  display: grid;
  grid-template-columns: 1fr 4fr;

  > div {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
  }

  dt {
    grid-column: 1;
  }

  dd {
    grid-column: 2;
  }
}
.loc {
  display: flex;
  width: 0.5em;
  aspect-ratio: 1;
  background: var(--color);
  border-radius: 50%;
}

#files dd {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  align-content: start;
  gap: 0.15em;
  padding-top: 0.6em;
  margin-left: 0;
}

#files code {
  font-family: monospace;
}

#files small {
  display: block;
  font-size: 0.8em;
  opacity: 0.6;
}
#scrolly-1 {
  position: relative;
  display: flex;
  gap: 1rem;

  > * {
    flex: 1;
  }
}

#scatter-story {
  position: relative;
}

#scatter-plot {
  position: sticky;
  top: 0;
  left: 0;
  bottom: auto;
  height: 50vh;
}
.step {
  padding-bottom: 40vh;
  max-width: 30em;
}