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;
    display: block;
    margin: 8px;
    margin-inline: auto;
    padding: 2px;
  }

  /* ul, li {
    display: contents;
  } */

  nav {
    --border-color: oklch(50% 10% 200 / 40%);
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: var(--border-color);
  }
  nav a {
    flex: 1;
    text-decoration: none;
    color: inherit;
    text-align: center;
    padding-bottom: 0.5em;
        
  }
  .current {
      border-bottom-width: .4em;
      border-bottom-style: solid;
      border-bottom-color: var(--border-color);
  }

  html {
    color-scheme: light dark;
    --color-accent: #1e90ff;
  }

  nav a:hover {
    border-bottom-width: .4em;
    border-bottom-style: solid;
    border-bottom-color: var(--color-accent);
    background-color: color-mix(in oklch, var(--color-accent), canvas 85%);
  }

  form {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1em
  }
  form label {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
  }
  
  form button {
    display: grid;
    grid-column: 1 / -1;
    width: 100%;
  }

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15em, 1fr));
}

/* Homepage hero */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.25rem;
  margin-block: 1rem 2rem;
}

.hero-text h1 {
  margin: 0 0 0.25rem 0;
}

.hero-text p {
  margin: 0;
}

.hero-img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
}

@media (max-width: 600px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-img {
    margin-inline: auto;
  }
}

.projects article {
  display: grid;
  grid-template-columns: subgrid;
  grid-row: span 3;
  gap: 0.5em;
}

.projects article img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
}

.projects .project-links {
  display: flex;
  gap: 0.75em;
  align-items: center;
  margin-top: -0.25em;
}

.projects .project-links a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}

.projects .project-links a:hover {
  text-decoration: underline;
}

/* h2 {
  margin: 0;
} */
h2 {
  margin-top: 40px;
  margin-bottom: 20px;
}

h1 {
  font-size: 300%;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.1;
  text-wrap: balance;
}

hr {
  margin-top: 3em;
  margin-bottom: 3em;
}

section article h3 {
  margin-top: 2em;
}

article time, article .present {
  font-size: 110%;
}

header p {
  font-size: 120%;
}

label.color-scheme {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

#profile-stats dl {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  margin-top: 20px;
}

#profile-stats dt {
  font-size: 14px;
  text-transform: uppercase;
  color: gray;
  grid-row: 1;
}

#profile-stats dd {
  font-size: 28px;
  font-weight: bold;
  margin: 0; /* Removes weird default margins */
  grid-row: 2;
}

#profile-stats {
  margin-bottom: 50px;
}

.project-year {
  font-size: 1em;
  color: gray;
  font-style: italic;
}

.container {
  display: flex;
  align-items: center;
  gap: 2em;
  margin: 2em auto;
  max-width: 1000px;
}

#projects-pie-plot {
  width: 300px;
  height: 300px;
  flex-shrink: 0;
}

.legend {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9em, 1fr));
  gap: 0.5em 1em;
  /* margin: 0.5em; */
  /* width: 1000px; */
  align-items: center;
  padding: 1em;
  border: 1px solid lightgray;
  border-radius: 19px;
  list-style: none;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.95em;
}

.swatch {
  width: 1em;
  aspect-ratio: 1 / 1;
  background-color: var(--color);
  display: inline-block;
  border-radius: 50%;
  border: 1px solid #ccc;
}

#projects-pie-plot:has(path:hover) path:not(:hover) {
  opacity: 0.5;
}

#projects-pie-plot path {
  transition: opacity 300ms ease;
  cursor: pointer;
}

.selected {
  --color: oklch(60% 45% 0) !important;
}

#projects-pie-plot path.selected {
  fill: var(--color) !important;
}

.legend-item.selected .swatch {
  background-color: var(--color) !important;
}

/* Stats Section - Table Layout (Using dt and dd) */
#stats {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 40px;
  margin: 40px auto;
  max-width: 800px;
  font-family: Arial, sans-serif;
  text-align: center;
}

/* Individual Stat Styling (Column Layout) */
#stats .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

/* Header Styling (Top, Small, and Subtle) */
#stats dt {
  font-size: 14px;
  text-transform: uppercase;
  color: gray;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* Value Styling (Large and Bold) */
#stats dd {
  font-size: 32px;
  font-weight: bold;
  margin: 0;
  color: #000;
}

/* Adaptive for Dark Mode */
html.dark-mode #stats dt {
  color: #adb5bd;
}

html.dark-mode #stats dd {
  color: #fff;
}

/* Add this to your CSS file */
.gridlines line {
  stroke: #cccccc; /* Light gray color */
  stroke-opacity: 0.5; /* Semi-transparent */
  stroke-width: 1;
}

/* CSS for .info class (Definition List Layout) */
.info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5em; /* Spacing between columns */
  margin: 0;
  padding: 0.5em;
}

.info dt {
  font-weight: bold;
  opacity: 0.7;
  margin: 0;
}

.info dd {
  margin: 0;
}

/* CSS for .tooltip class (Positioning) */
.tooltip {
  position: fixed;
  top: 1em;
  left: 1em;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  padding: 0.5em 1em;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

circle {
  transition: 200ms;
  transform-origin: center;
  transform-box: fill-box;
}

circle:hover {
  transform: scale(1.5);
}

dl.info {
  /* ... other styles ... */
  transition-duration: 500ms;
  transition-property: opacity, visibility;
}

dl.info[hidden]:not(:hover, :focus-within) {
  opacity: 0;
  visibility: hidden;
}

@keyframes marching-ants {
  to {
    stroke-dashoffset: -8; /* 5 + 3 */
  }
}

.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;
}

/* Language Breakdown Styling */
#language-breakdown {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-top: 1rem;
  font-family: Arial, sans-serif;
}

#language-breakdown dt {
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

#language-breakdown dd {
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
  margin: 0;
  color: #333;
}

#selection-count {
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
  margin: 1rem 0;
}


#files {
  display: grid;
  grid-template-columns: 1fr 4fr;
  gap: 0.5em;
  margin-top: 2em;
}

#files > div {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: baseline;
}

#files dt {
  grid-column: 1;
}

#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;
}

.loc {
  width: 0.5em;
  aspect-ratio: 1;
  background: var(--color, steelblue);
  border-radius: 50%;
}

#scrolly-1 {
  position: relative;
  display: flex;
  gap: 1rem;
}

#scrolly-1 > * {
  flex: 1;
}

#scatter-plot {
  position: sticky;
  top: 0;
  height: 50vh;
}

#scatter-story .step {
  padding-bottom: 100vh;
  border-left: 3px solid var(--color-accent);
  padding-left: 1rem;
  margin-bottom: 2rem;
}