:root {
  --color-accent: oklch(80% 3% 200); /* A specific accent color */
  accent-color: var(
    --color-accent
  ); /* Ensure form elements inherit the accent color */
}
html {
  color-scheme: light dark;
}
body {
  max-width: 100ch;
  margin-inline: auto;
  padding: 1rem;
  font: 100%/1.5 system-ui;
  margin-bottom: 20em;
}
nav {
  display: flex;
  --border-color: oklch(80% 3% 200 / 40%);
  --background-color: color-mix(in oklch, var(--color-accent), canvas 85%);
}
label.color-scheme {
  position: absolute;
  top: 1rem; /* Distance from the top edge of the page */
  right: 1rem; /* Distance from the right edge of the page */
  font-size: 80%; /* Makes the font a bit smaller */
  font-family: inherit; /* Inherits the font family from the parent */
}
nav a {
  flex: 1;
  text-decoration: none;
  color: inherit;
  text-align: center;
  padding: 0.5rem;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}
nav a.current {
  border-bottom: 0.4em solid var(--border-color);
  padding-bottom: 0.6em;
  font-weight: bold;
}
nav a:hover {
  background-color: var(--background-color);
  border-bottom: 0.4em solid var(--color-accent);
  padding-bottom: 0.6em;
}
form {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1em;
}
label {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
}
button {
  grid-column: 1 / -1;
}
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15em, 1fr));
  gap: 1.5em;
}
.projects article {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
}
.projects h2 {
  margin: 0;
}
h1 {
  font-size: 400%;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.1;
  text-wrap: balance;
}
.item {
  display: flex;
  align-items: flex-start;
  gap: 2em;
  margin-bottom: 2em;
}
.item-image {
  width: 250px;
  height: auto;
  border-radius: 0.5em;
  object-fit: cover;
}
.resume .item-details {
  max-width: 800px;
}
.profile {
  display: flex;
  align-items: flex-start;
  gap: 2em;
  margin: 4em 0;
  padding: 2em;
}
.profile-details {
  max-width: 720px;
}
.profile-details h2{
  font:Exile;
}
.profile-image {
  width: 500px;
  height: 500px;
  border-radius: 50%;
  object-fit: cover;
}
.stats-box dl {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 equal columns */
  gap: 1rem;
  margin-top: 1rem;
  text-align: center;
}
.stats-box dt {
  grid-row: 1;
  font-size: 1rem;
  text-transform: uppercase;
}

.stats-box dd {
  margin: 0;
  grid-row: 2;
  font-size: 1.5rem;
  padding: 0.5rem;
  text-transform: uppercase;
}
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  justify-items: center;
}

.projects img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0.5rem;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  display: block;
}

.projects img:hover {
  transform: scale(1.05) translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}
#projects-pie-plot {
  max-width: 20em;
  margin-block: 2em;
  overflow: visible;
}
#projects-pie-plot path {
  transition: 300ms;
}
#projects-pie-plot:has(path:hover) path:not(:hover) {
  opacity: 0.5;
}
.selected {
  --color: oklch(
    0.67 0.1431 347.69
  ) !important; /* Fixed color syntax: spaces required */
}
path.selected {
  --color: var(--color);
}
path {
  fill: var(--color);
  cursor: pointer;
  transition: fill 0.3s ease;
}
.swatch {
  width: 1em; /* fixed width */
  height: 1em; /* fixed height */
  aspect-ratio: 1 / 1; /* makes it square if one dimension is missing */
  background-color: var(--color); /* use dynamic color from JS */
  border-radius: 0.5em; /* slight rounding (change to 50% for full circle) */
  display: inline-block; /* crucial for width/height to apply */
  margin-right: 0.5em; /* space before the label text */
}
.legend-item .swatch {
  background-color: var(--color);
}
.legend {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9em, 1fr));
  gap: 1em; /* larger gap between grid cells */
  list-style: none;
  padding: 1em;
  margin: 0;
  border: 1px solid var(--color-accent);
}
.legend-item.selected {
  opacity: 1;
  font-weight: bold;
}
.container {
  display: flex;
  align-items: center;
  gap: 3.5em;
}
.SearchBar {
  width: 100%;
  padding: 0.75em 1em 0.75em 2.5em;
  font-size: 1rem;
  margin: 2rem auto;
  font-family: inherit;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: url("https://cdn-icons-png.flaticon.com/512/622/622669.png")
    no-repeat 0.75em center;
  background-size: 1em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition:
    border 0.2s ease,
    box-shadow 0.2s ease;
}
dl.info{
  display: grid;
  transition-duration: 500ms;
  transition-property: opacity, visibility;
}
dl.info[hidden]:not(:hover, :focus-within) {
  opacity: 0;
  visibility: hidden;
}
.tooltip{
  position: fixed;
  top: 1em;
  left: 1em;
}
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 2s linear infinite;
}
circle.selected {
  fill: #ff6b6b;
}
#language-breakdown {
  display: grid;
  align-items: center;
}

#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%;
}
dd {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  align-content: start;
  gap: 0.15em;
  padding-top: 0.6em;
  margin-left: 0;
}
#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: 70em;
}