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: 3ch;
}
.profile-photo {
    /* Resize profile photo
    */
    display: block;
    width: 200px;
    max-width: 80%;
    height: auto;
}
nav ul {display: contents;}
nav li {display: contents;}
nav {
    display: flex;
    margin-bottom: 1em;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    --border-color: oklch(50% 10% 200 / 40%);
    border-bottom-color: var(--border-color);
    padding-top: 3rem;
}
a.link:hover {
    text-decoration: underline;
}
nav a {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: inherit;
    padding: 0.5em;
}
nav a.current {
    font-weight: bold;
    border-bottom: 0.4em solid oklch(80% 3% 200);
    padding-bottom: 0.1em;
}
:root {
    --color-accent: oklch(65% 50% 0);
    accent-color: var(--color-accent);
}
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%);
}
form {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1em;
}
input, textarea, button, select {
    font: inherit;
}
label, button {
    /*Only argument that works for button here is grid-col
        so everything else is fine to keep here and does not
        mess up the button
    */
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
}
.projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15em, 1fr));
    gap: 1rem;
}
.projects article {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 3;
    gap: 1em;
    margin: 0;
}
.projects article h2 {
    margin: 0;
}
h1 {
    font-size: 400%;
}
h1, h2, h3, h4, h5, h6 {
    line-height: 1.1;
    text-wrap: balance;
}
section {
    border-top: 1px solid oklch(80% 3% 200);
    padding-top: 1em;
    margin-block: 1.5em;
}
section article p, 
section article ul {
    margin-block: 0.25em;
}
section h2 {
    color: var(--color-accent);
    margin-bottom: 0.5em;
}
.color-scheme {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 80%;
}
#profile-stats dl {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
#profile-stats dt {
    grid-row: 1;
    font-weight: bold;
}
#profile-stats dd{
    grid-row: 2;
    margin: 0;
}
.projects img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: contain;
    background-color: white;
}
.projects year {
    font-family: Baskerville;
    font-variant-numeric: oldstyle-nums;
}
#projects-pie-plot {
    max-width: 20em;
    margin-block: 2em;
    overflow: visible;
}
.projects article > div {
    display: flex;
    flex-direction: column;
}
.projects article > div p:first-of-type {
    flex: 1;
}
.swatch {
    display: inline-block;
    width: 1em;
    aspect-ratio: 1/1;
    background-color: var(--color);
    border-radius: 50%;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5em;
}
.legend {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9em, 1fr));
    gap: 1em;
    padding: 1em;
    border: 1px solid oklch(80% 3% 200);
    margin: 1em;
    list-style: none;
    flex: 1;
}
.container {
    display: flex;
    align-items: center;
    gap: 2em;
}
.searchBar {
    margin-block: 1em;
}
path {
    cursor: pointer;
    transition: 300ms;
}
#projects-pie-plot:has(path:hover) path:not(:hover) {
    opacity: 0.5;
}
.selected {
    --color: oklch(60% 45$ 0) !important;
}
.selected:is(path) {
    fill: var(--color);
}
.stats {
    display: grid;
    grid-template-columns: auto auto;
    gap: 0.5em 1em;
}
.stats dt {
    font-weight: 600;
    color: gray;
}
.stats dd {
    margin: 0;
    font-weight: bold;
}
.gridlines line {
    stroke: #ddd;
    stroke-opacity: 0.7;
}
.gridlines path {
    display: none;
}
dl.info {
    display: grid;
    grid-template-columns: auto auto;
    gap: 0.5em 1em;
    margin: 0;
    transition-duration: 500ms;
    transition-property: opacity, visibility;
}
dl.info dt {
    color: gray;
    font-weight: 600;
}
dl.info dd {
    margin: 0;
}
dl.info[hidden]:not(:hover, :focus-within) {
    opacity: 0;
    visibility: hidden;
}
.tooltip {
    position: fixed;
    top: 1em;
    left: 1em;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 1em;
    backdrop-filter: blur(4px);
}
circle {
    transition: 200ms;
    transform-origin: center;
    transform-box: fill-box;
    @starting-style {
        r: 0;
    }
}
circle:hover {
    transform: scale(1.5);
}
circle.selected {
    fill: #ff6b6b;
}
@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;
}
.project-footer {
    display: flex;
    align-items: baseline;
    gap: 1em;
    margin-top: auto;
}
.project-year {
    margin: 0;
}
.project-footer a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}
.project-footer a:hover{
    opacity: 0.7;
}
.loc {
    display: flex;
    width: 0.5em;
    aspect-ratio: 1;
    background: var(--color);
    border-radius: 50%;
}
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 {
    display: grid;
    grid-template-columns: 1fr 4fr;
}
#files > div {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
}
#files dt {
    grid-column: 1;
}
#files dd {
    grid-column: 2;
}
.step {
    padding-bottom: 60vh;
    padding-top: 1em;
    border-top: 1px solid oklch(80% 3% 200);
}
#scrolly-1 {
  position: relative;
  display: flex;
  gap: 1rem;
}

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

#scatter-story {
  position: relative;
}

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