:root {
  --color-accent: rgb(230, 230, 250);
  color-scheme: light dark;
}
/* :root[color-scheme="dark"] {
  --background-color: dark;
}
:root[color-scheme="light"] {
  --background-color: light;
} */

html{
  accent-color: var(--color-accent);
}
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;
  padding: 0.5em;
  margin-inline: auto;
  text-decoration: none;
  text-align: center;
  /* width: 100%;
  box-sizing: border-box; */
  max-width: 130ch;
}

nav{
  display: flex;
  color: inherit;
  padding: 0.5em;
  text-align: center;
  text-decoration: none;
  margin-bottom: 1rem;
  border-bottom-width: 1px;
  border-bottom-style: solid;
  border-bottom-color: oklch(80% 3% 200);
  --border-color: oklch(50% 10% 200 / 40%);
  border-bottom-color: var(--border-color);
  
}
nav ul {
  padding: 100px;
  display: contents;
}
nav li{
  display: contents;
}
nav a{
  flex: 1;
  text-decoration: none;
}
nav a.current{
  border-bottom-width: 1px;
  border-bottom: 0.4em solid oklch(80% 3% 200);
  padding-bottom: 0.4rem;
}
nav a:hover {
  font-size: 18px;
  /* color: var(--color-accent); */
  background-color: oklch(from var(--color-accent) 95% 5% h);
  background-color: color-mix(in oklch, var(--color-accent), canvas 85%);
}
img{
  padding: 1em;
}
/* home */
.image{
  border: 1px solid #ddd;
  border-radius: 15px;
  padding: 1em;
  transition: .5s ease;
  backface-visibility: hidden;
  margin: 20px 220px 20px 220px;
}
.middle {
  transition: .5s ease;
  opacity: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  padding: 16px 32px;
}

.text {
  text-align: center;
  background-color:  rgb(179, 179, 211);
  color: white;
  font-size: 16px;
  padding: 16px 32px;
}
.face:hover .image{
  opacity: 0.3;
}
.face:hover .middle{
  opacity: 1;
}
/* contact/index.html */
form{
  gap:1em;
  display: grid;
  grid-template-columns: auto 1fr;
  padding: 1em 1em;

}
textarea{
  padding: 0.5em;
  font: inherit;
  grid-column: 2;
}
input, button{
  font: inherit;
  grid-column: 2;
}
label{
  display: contents;
  grid-column: 1 / -1;
  gap: 1em;
}

/* project/index.html */
.projects{
  display: grid;
  grid-template-columns:repeat(auto-fill, minmax(15em, 1fr));
  min-width: 15em;
  max-width:1fr;
  vertical-align: middle;
}
.projects article{
  grid-template-rows: subgrid;
  grid-row: span 3;
  gap: 2em;
  padding: 0 0.5em;
}
article img{
  /* justify-content: center;
  align-items: center; */
  position: relative;
  max-height: 140px;
  max-width: 250px;

}
.projects h1, h2, h3, h4, h5, h6{
  text-decoration: none;
  padding: 0.5em;
  line-height: 1.1;
  text-wrap: balance;
}
.projects h2{
  text-decoration: none;
  margin: 0
}
label.color_scheme{
  position: absolute;
  top: 1rem;
  right:1rem;
  font-size: 0.8rem;
  font-family: inherit;
}

/* lab 4 */
#profile-stats h2 {
  text-align: left;
}

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

#profile-stats dt {
  grid-row: 1;
  text-transform: capitalize;
  color:#737782
}

#profile-stats dd {
  grid-row: 2;
  font-size: 24px;
}

/* lab 5 */
#projects-plot{
  max-width: 20em;
  margin-block: 2em;
  overflow: visible;
}

.container {
  display: flex;
  padding: 10px; /* Adds spacing inside */
  height: fit-content;
  align-items: center; /* Aligns pie chart and legend vertically */
  justify-content: center; /* Centers both items */
  margin: auto; 
}


.legend {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  column-gap: 70px;
  display: grid;
  border: 1px solid #ccc; /* Optional: adds a subtle border */
  height: fit-content;
  width: 100%; /* Ensures it expands properly */
  gap: 15px; /* Adds spacing between legend items */
  list-style: none; /* Removes bullet points */
  align-items: center; /* Aligns items vertically */
  flex-wrap: wrap; /* Ensures wrapping when needed */
  padding: 2em;
  margin: 2em;
  text-align: left;
  /* vertical-align: middle; */
}

.legend li {
  display: flex;
  align-items: center; /* Aligns text with circles */
  gap: 8px; /* Adds space between circle and text */
}

.legend .swatch {
  width: 20px; /* Set the size of color circles */
  height: 20px;
  border-radius: 50%; /* Makes them circular */
  background-color: var(--color); /* Assigns the correct color */
  display: inline-block;
}

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

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

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

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

.searchBar{
  justify-content: center;
  align-items: center;
  margin: 1em;
}

/* lab 6 */
#stats h2 {
  text-align: left;
}

#stats dl {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  gap: 10px;
}

#stats dt {
  grid-row: 1;
  text-transform: capitalize;
  color:#737782
}

#stats dd {
  grid-row: 2;
  font-size: 24px;
}

.gridlines{
  color:#ccc
}

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

circle.selected {
  fill: #ff6b6b;
}

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

#commit-tooltip {
  background-color: oklch(from var(--color-accent) 95% 5% h);
  background-color: color-mix(in oklch, var(--color-accent), canvas 60%);
  box-shadow: 5px 5px 5px oklch(from var(--color-accent) 95% 5% h); 

  /* Hides tooltip by default */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease-in-out;
}

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

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

#selection-count{
  font-weight: bold;
}

dl.stats {
  display: flex;
  justify-content: space-around; /* Spreads columns evenly */
  text-align: center;
  gap: 20px;
}

dl.stats div {
  display: flex;
  flex-direction: column; /* Stack dt & dd inside each column */
  align-items: center;
}

p1.intro {
  text-align:left;
  min-width: 3em;
  max-width: 30px;
  padding: 40px;
  margin: 40px;
}