:root {
    --color-accent: color-mix(in oklch, oklch(0.8086 0.0954 267.19), canvas 85%);
    color-scheme: light;
}

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-left: auto;
    margin-right: auto;
    padding-left: 10ch;
    padding-right: 10ch;
}

nav {
    display: flex;
    border-bottom: 1px solid oklch(50% 10% 200 / 40%);
}

nav ul, nav li {
    display: contents;
}

nav a {
    flex: 1;
    text-decoration: none;
    color: inherit;
    text-align: center;
    padding: 0.4em;
}

nav a:hover {
    border-bottom: 0.2em solid oklch(0.8086 0.0954 267.19);
    background-color: var(--color-accent);
}

.current {
    border-bottom: 0.2em solid oklch(50% 10% 200 / 40%);
}

form {
    display: grid;
    grid-template-columns: auto 1fr;
}

form input, form textarea, form button {
    font: inherit;
}

form label {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
    gap: 1em;
    padding: 0.4em;
}

form button {
    grid-column: 1 / -1;
}

.projects {
    display: flex;
    flex-direction: column;
    background-color: var(--color-accent);
    padding: 0.5em;
    gap: 0.3em;
    box-shadow: 0 0 3px lightslategray;
    border-radius: 4px;
    margin-block: 1rem;
}

.projects article {
    display: grid;
    grid-template-columns: 15em 1fr;
    gap: 1em;
    padding: 0.6em;
    margin: 0.6em;
    background-color: var(--color-accent);
    box-shadow: 0 0 3px lightslategray;
    border-radius: 4px;
}

.projects article .tags {
    display: flex;
    margin: 12px 0;
    flex-direction: row;
    align-items: center;
    justify-content: left;
    gap: 0.8em;
}

.projects article .tag {
    padding: 0.5em 1em;
    font-family: inherit;
    font-size: 12px;
    border-radius: 16px;
    background-color: color-mix(in oklch, oklch(0.8086 0.0954 267.19), canvas 60%);
    box-shadow: 0 0 2px lightgray;
}

.projects article .info {
    color: gray;
    font-size: 12px;
}

.projects article img {
    border: solid 1px lightgray;
    border-radius: 4px;
}

.projects article h2 {
    margin-top: 0.6em;
    margin-bottom: 0.6em;
    font-size: 20px;
    line-height: 1;
}

.projects article p {
    font-size: 14px;
    margin-top: 0.6em;
    margin-bottom: 0.6em;
}

.projects a {
    text-decoration: none;
    color: inherit;
}

h2 a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

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

label.color-scheme {
    font-family: inherit;
    font-size: 85%;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

#profile-stats dl {
    display: grid;
    column-gap: 48px;
}

#profile-stats dt {
    grid-row: 1;
    font-size: 12px;
    font-family: inherit;
    color: lightslategray;
}

#profile-stats dd {
    grid-row: 2;
    margin: 0;
    font-size: 20px;
}

#projects-plot {
    width: 40%;
    max-width: 20em;
    overflow: visible;
}

.swatch {
    display: inline-flex;
    width: 20px;
    aspect-ratio: 1 / 1;
    background-color: var(--color);
    border-radius: 50%;
}

.legend {
    display: grid;
    grid-template-rows: auto 1fr;
    grid-template-columns: repeat(auto-fill, minmax(8em, 1fr));
    align-items: center;
    list-style-type: none;
    gap: 16px;
    padding: 16px;
    border: 3px solid var(--color-accent);
    border-radius: 10px;
    flex: 1;
}

#key {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: auto;
    padding: 10px;
}

#key em {
    color: gray;
    font-size: 12px;
}

.container {
    display: flex;
    width: 100%;
    gap: 24px;
    align-items: center;
    margin-block: 2rem;
}

&:has(path:hover) {
    path:not(:hover) {
      opacity: 0.5;
    }
}

path {
    transition: 300ms;
    cursor: pointer;
}

.selected {
    --color: oklch(0.29 0.1423 296.21) !important;

    &:is(path) {
        fill: var(--color);
    }

    &:is(span) {
        border: 1px solid red;
    }
}

.searchBar {
    display: flex;
    width: 100%;
    height: 36px;
    margin: 0 0 32px 0;
    font-family: inherit;
    text-align: center;
}

#meta-stats dl {
    display: grid;
    column-gap: 48px;
}

#meta-stats dt {
    grid-row: 1;
    font-size: 12px;
    font-family: inherit;
    color: lightslategray;
}

#meta-stats dd {
    grid-row: 2;
    margin: 0;
    font-size: 20px;
}

.gridlines {
    opacity: 0.4;
}

dl.info {
    display: grid;
    transition-duration: 500ms;
    transition-property: opacity, visibility;
    column-gap: 12px;
    padding: 12px;
}

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

dl.info dt {
    grid-row: 1;
    margin: 0;
    font-size: 10px;
    color: lightslategray;
    font-family: inherit;
}

dl.info dd {
    grid-row: 2;
    margin: 0;
    font-size: 14px;
    font-family: inherit;
}

.tooltip {
    position: fixed;
    top: 1em;
    left: 1em;
    box-shadow: 0 0 4px lightslategray;
    border-radius: 10px;
    backdrop-filter: blur(2px);
}

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

    @starting-style {
        r: 0;
    }
}

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

@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 0.5s linear infinite;
}

circle.selected {
    fill: #ff6b6b;
}

#selection-count {
    text-align: center;
    font-size: 14px;
    color: lightslategray;
    margin: 16px 0 32px 0;
}

#language-breakdown {
    display: grid;
    text-align: center;
    column-gap: 32px;
    row-gap: 2px;
}

#language-breakdown dt {
    grid-row: 1;
    font-size: 12px;
    font-family: inherit;
    color: lightslategray;
}

#language-breakdown dd {
    grid-row: 2;
    margin: 0;
    font-size: 20px;
}

hr.separator {
    margin: 32px 0 32px 0;
}

#commit-filter {
    flex: 1;
    align-items: baseline;
    width: 100%;
    font-size: 12px;
    text-align: right;
    margin: 0;
}

#commit-filter input {
    width: 86%;
    height: 6px;
    align-self: second baseline;
}

#commit-filter time {
    display: block;
    margin-left: auto;
    font-size: 12px;
}

abbr {
    cursor: pointer;
}