html {
  --color-accent: oklch(65% 50% 0);
  accent-color: var(--color-accent); 
  color-scheme: light dark;
}
.color-scheme {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 0.8em;
  font-family: inherit;
}
.color-scheme select {
  font: inherit;
}
body {
    font: 100%/1.5 system-ui;
    max-width: 800px;
    padding: 100px;
    margin-left: auto;
    margin-right:auto;
  }
  nav ul,
  nav li {
    display: contents;
  }
  nav {
    display: flex;
    margin-bottom: 1em;
    --border-color: oklch(50% 10% 200 / 40%);
  }
  nav a {
    flex: 1;
    text-decoration: none;
    color: inherit;
    text-align: center;
    padding: 0.5em;
    border-bottom: 0.1em solid var(--border-color);
    padding-bottom: 0.1em;
  }
  nav a.current {
    border-bottom: 0.4em solid var(--border-color); 
    padding-bottom: 0.1em;                       
  }
  nav a:hover {
    border-bottom: 0.4em solid var(--color-accent); 
    padding-bottom: 0.1em;
    background-color: color-mix(in oklch, var(--color-accent), canvas 85%);                
  }
  body.contact-page form {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1em;
  }
  body.contact-page form label {
    display: grid;
  }
  body.contact-page form input,
  body.contact-page form textarea,
  body.contact-page form button {
  font: inherit;
  width: 100%;
  box-sizing: border-box;
  }
  body.contact-page form button {
    grid-column: 1 / -1;
  }
  body.project-page .projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15em, 1fr));
    gap: 1em;
  }
  body.project-page .projects article {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 3;
    gap: 1em;
  }
  body.project-page .projects article h2 {
    margin: 0 0 1rem 0;
  }
  h1, h2, h3, h4, h5, h6 {
    line-height: 1.1;
    text-wrap: balance;
  }
  h1 {
    font-size: 4em;
  }
  body.resume-page h2 {
    font-size: 2em;
    margin-bottom: 0.5em;
    border-bottom: 2px solid oklch(80% 3% 200);
    padding-bottom: 0.2em;
  }
  body.resume-page h3 {
    font-size: 1.2em;
    margin-top: 0.5em;
    margin-bottom: 0.2em;
    font-weight: normal;
  }
  body.resume-page section {
    margin-bottom: 2em; 
  }
  body.resume-page a {
    text-decoration: none;
    color: inherit; 
    text-align: center;
    padding: 0.5em;
    border-bottom: 2px solid oklch(80% 3% 200);
  }
  body.resume-page a:hover {
    text-decoration: underline;
    color: var(--color-accent);
    border-bottom: 0.2em solid var(--color-accent); 
    padding-bottom: 0.05em;
    background-color: oklch(from var(--color-accent) 95% 5% h);   
  }
  body.resume-page ul {
    margin-left: .5em;
  }
  #profile-stats dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
    text-align: center;
}
#profile-stats dt {
    grid-row: 1;
    font-weight: bold;
    text-align: center;
}
#profile-stats dd {
    grid-row: 2;
    margin: 0;
    text-align: center;
}
.project-img {
  max-width: 600px;
  height: auto;
  display: block;
  margin: 0;
}
body.project-page .projects img.project-img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0;
}
body.project-page .projects article {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.project-year {
  font-family: "Baskerville", Baskerville, "Times New Roman", serif;
  font-variant-numeric: oldstyle-nums;
  margin: 0
}
#projects-pie-plot {
  max-width: 20em;
  margin-block: 2em;

  overflow: visible;
}
.legend .swatch {
  width: 1rem;
  aspect-ratio: 1 / 1;
  background-color: var(--color);
  border-radius: 50%;
  display: inline-block;
}
.legend {
  flex: 1;
  min-width: 100px;  
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7em, 1fr)); 
  gap: 0.5rem 1rem;
  list-style: none;
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.container {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: nowrap;
}

.container svg {
  flex: 1 1 150px;
  max-width: 100%;           
  height: auto;              
  min-width: 50px;
}
.searchBar {
  width: 100%;
  padding: 0.5rem 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1.2rem; 
  margin-bottom: 1.5rem;
}
.searchBar:focus {
  outline: none;
  border-color: blue; 
  box-shadow: 0 0 0 2px rgba(0, 0, 255, 0.2);
}
.searchBar::placeholder {
  font-size: 1.25rem;
  color: #888;
}
#projects-pie-plot:has(path:hover) path:not(:hover) {
  opacity: 0.5;
}
#projects-pie-plot path {
  cursor: pointer;
  transition: 300ms;
}
#projects-pie-plot path.selected {
  fill: oklch(60% 45% 0) !important;
}
#website-stats {
  display: grid;
  grid-template-rows: auto auto; /* 2 rows: labels + values */
  grid-auto-flow: column;        /* fill columns left to right */
  gap: 1.5rem;                   /* horizontal spacing */
  justify-content: center;       /* center horizontally */
  margin-top: 1rem;
  text-align: center;
}

#website-stats dt {
  font-weight: bold;
}

#website-stats dd {
  margin: 0;
}
#chart .gridlines line {
  stroke: #ccc;
  stroke-opacity: 0.3;
  shape-rendering: crispEdges; 
}
#chart .gridlines path {
  display: none;
}
dl.info {
  display: grid;
  grid-template-columns: auto 1fr;
  margin: 0;
  transition-duration: 500ms;
  transition-property: opacity, visibility;
}
dl.info dt,
dl.info dd {
  margin: 0;
  padding: 0.2em 0;
}
dl.info dt {
  font-weight: normal;
}
dl.info dd {
  margin: 0;
  padding-left: 0.5em; /* adds some space between the label and the value */
}
.tooltip {
  position: fixed;
  top: 1em;
  left: 1em;
  pointer-events: none;
}
dl.info[hidden]:not(:hover, :focus-within) {
  opacity: 0;
  visibility: hidden;
}
circle {
  transition: all 200ms, r calc(var(--r) * 100ms);
  transform-origin: center;
  transform-box: fill-box;

  @starting-style {
    r: 0;
  }
}

circle:hover {
  transform: scale(1.75);
}
@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;
}
#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 small {
  display: block;
  font-size: 0.75em;
  line-height: 1.1;
  opacity: 0.6;
  font-family: inherit;
  margin-top: 0.1em;
}
#scrolly-1 {
  position: relative;
  display: flex;
  gap: 1rem;

  > * {
    flex: 1;
  }
}

#scatter-story {
  position: relative;
}

#scatter-plot {
  position: sticky;
  top: 2rem;          /* adds space from top of window */
  height: 100vh;       /* larger plot height (was 50vh) */
  padding-top: 2rem;
}
#scatter-plot {
  flex: 2.25;   /* scatter plot wider than story text */
}

#scatter-story {
  flex: 0.75;   /* story narrower */
  padding-right: 1rem;
}
.step {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 300ms ease, transform 300ms ease;
  padding-bottom: 3rem; /* keeps spacing nice */
}

.step.is-active {
  opacity: 1;
  transform: translateY(0);
}

