html {
  --color-accent: oklch(65% 50% 0);
}

body {
  max-width: 100ch;
  line-height: 1.5;
  font: 100%/1.5 system-ui;
  margin-inline: auto;
  padding: 2ch;
  accent-color: var(--color-accent);
}


/* navigation */

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

nav a {
  flex: 1;
  text-decoration: none;
  color: inherit;
  text-align: center;
  padding: 0.5em;
  margin-bottom: auto;
}

nav a.current {
  border-bottom: 0.4em solid oklch(80% 3% 200);
}

nav a:hover {
  border-bottom: 0.4em solid var(--color-accent);
  background-color: color-mix(in oklch, var(--color-accent), canvas 85%);
}


/* contact form */

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

label, button {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
}

button {
  display: flex;
  justify-content: center;
}


/* projects */

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15em, 1fr));
  column-gap: 1em;
}

.project-image {
  max-width: 100%;
  max-height: 100%;
  display: block;
  margin: 1rem 0;
}

article {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
  gap: 1em;
}

h2 {
  margin: 0;
}
h1 {
  font-size: 400%;
}
h1, h2, h3, h4, h5, h6 {
  line-height: 1.1;
}


/* resume */

.resume {
  padding-top: 0.3em;
  line-height: 1;
}

.resume h1 {
  font-size: 200%;
}

.resume h3 {
  margin-bottom: 0em;
}

.resume section h2 {
  border-bottom: 2px solid black;
  margin-bottom: 0.8em;
}

.resume section ul {
  margin: 0;
  padding-left: 2ch;
}

.line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.right-side {
  margin-left: auto;
  text-align: right;
}

.header header {
  text-align: center;
  padding: 1em;
}

.contact {
  display: flex;
  justify-content: center;
  gap: 5em;
}

.header, .education, .skills, .experience {
  margin-bottom: 1em;
}


/* dark mode */

.color-scheme {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 80%;
}


/* home page stats */

#profile-stats {
  width: 100%;
  max-width: none;
  margin: 2em 0;
  text-align: left;
  padding: 0;
}

#profile-stats h2 {
  font-size: 1.8em;
  font-weight: bold;
  margin-bottom: 1em;
  text-align: left; /* Align title to the left */
}

#profile-stats dl {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Keeps four equal columns */
  text-align: left;
  gap: 0.5em 1em;
  width: 100%; /* Ensure the grid takes full width */
}

#profile-stats dt {
  font-size: 0.9em;
  color: #666;
  font-weight: bold;
  text-transform: uppercase;
  grid-row: 1;
  text-align: left;
}

#profile-stats dd {
  font-size: 2em;
  font-weight: bold;
  margin: 0;
  grid-row: 2;
  text-align: left;
}


/* pie chart */

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

.swatch {
  width: 15px;  /* Set width */
  height: 15px;  /* Set height */
  aspect-ratio: 1 / 1;  /* Ensures it's a square */
  background-color: var(--color);  /* Uses a CSS variable for dynamic colors */
  border-radius: 3px;  /* Slight rounding of corners */
  display: inline-block;  /* Allows width & height to take effect */
  margin-right: 10px;  /* Space between the swatch and text */
}
 
.legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9em, 1fr));
  gap: 10px; /* Adds spacing between legend items */
  padding: 0;
  list-style: none; /* Removes default bullet points */
  border: 1px solid #ccc;  /* Adds a light gray border */
  padding: 10px;  /* Adds padding inside the border */
  margin: auto; /* Centers the legend */
}

.legend-item {
  display: flex; /* Aligns swatch and text horizontally */
  align-items: center; /* Vertically centers swatch and text */
  gap: 5px; /* Adds space between swatch and text */
}

.container {
  display: flex;  /* Arrange pie chart and legend in a row */
  align-items: center;  /* Center content horizontally */
  gap: 20px;  /* Add space between pie chart and legend */
}

.legend {
  flex: 1;
}

.searchBar {
  width: 100%;
  height: 56px;
  font-size: 18px;
  padding: 0 16px;
  border: 1px solid #ccc;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

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

path {
  transition: 300ms;
}

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

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

/* metadata stats */
#stats {
  width: 100%;
  max-width: none;
  margin: 2em 0;
  text-align: left;
  padding: 0;
}

#stats h2 {
  font-size: 1.8em;
  font-weight: bold;
  margin-bottom: 1em;
  text-align: left; /* Align title to the left */
}

#stats dl {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Keeps four equal columns */
  text-align: left;
  gap: 0.5em 1em;
  width: 100%; /* Ensure the grid takes full width */
}

#stats dt {
  font-size: 0.9em;
  color: #666;
  font-weight: bold;
  text-transform: uppercase;
  grid-row: 1;
  text-align: left;
}

#stats dd {
  font-size: 2em;
  /* font-weight: bold; */
  margin: 0;
  grid-row: 2;
  text-align: left;
}

/* Make gridlines subtle */
.gridlines line {
  stroke: #ddd; /* Light gray color */
  stroke-opacity: 0.6; /* Make them slightly transparent */
  shape-rendering: crispEdges; /* Ensures clean, sharp lines */
}

/* Remove extra ticks at the ends of the gridlines */
.gridlines path {
  display: none;
} 

dl.info {
  display: grid;
  grid-template-columns: auto 1fr; /* First column auto-sized, second column flexible */
  gap: 0.5em 1em; /* Adjust spacing */
  align-items: start; /* Aligns text to the top */
  transition-duration: 500ms;
  transition-property: opacity, visibility;
}


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

dl.info dt {
  font-weight: bold;
  color: #666; /* Makes labels less prominent */
  text-transform: uppercase;
}

dl.info dd {
  margin: 0; /* Removes default margin */
  font-weight: normal; /* Keeps values normal weight */
}

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

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

#commit-tooltip {
  position: fixed;
  top: 1em;
  left: 1em;
  background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent white */
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); /* Subtle elevation effect */
  border-radius: 8px; /* Rounded corners */
  backdrop-filter: blur(10px); /* Frosted glass effect */
  padding: 10px; /* Spacing inside the tooltip */
  font-size: 14px;
  color: black;
}

circle.selected {
  fill: #ff6b6b;
}

#language-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 equal columns */
  grid-template-rows: repeat(2, auto); /* 2 rows */
  gap: 0.5em;
  text-align: center;
}

#language-breakdown dt {
  font-size: 1.2em;
  grid-row: 1; /* Ensures all dt elements stay in the first row */
}

#language-breakdown dd {
  font-size: 1.2em;
  grid-row: 2; /* Ensures all dd elements stay in the second row */
}

#slider-container {
  display: flex;
  align-items: center;
  margin-bottom: 1em;
  gap: 1em;
}

#commit-slider {
  flex: 1;
  appearance: none;
  height: 8px;
  background-color: #ddd;
  border-radius: 5px;
  outline: none;
}

#commit-slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #0053e7;
  cursor: pointer;
}

#commit-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #0053e7;
  cursor: pointer;
}

#selectedTime {
  min-width: 200px;
  text-align: right;
  color: #333;
}

.stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.stats dt {
  font-weight: bold;
  margin-right: 5px;
}

.stats dd {
  margin: 0;
  padding-right: 20px;
}

.files {
    display: grid;
    gap: 0.5em;
    margin-top: 1em;
}
/* For scrollytelling unit visualization items */
.line {
  display: flex;
  width: 0.5em;
  aspect-ratio: 1;
  background: steelblue;
  border-radius: 50%;
}

dd {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    gap: 0.15em;
    padding-top: 0.6em;
    margin-left: 0;
}

:global(body) {
  max-width: min(120ch, 80vw);
}

#scrollytelling {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
}

/* feel free to play with this to make your scrolly more seemless with your plot */
#scroll-container {
  grid-column: 1;
  position: relative;
  width: 95%;
  height: 350px;
  overflow-y: scroll;
  border: 1px solid #ccc;
  margin-bottom: 50px;
}

#chart {
  grid-column: 2;
}

#spacer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: none; /* transparent */
  pointer-events: none;
}

#items-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.item {
  height: 100px;
  padding: 10px;
  box-sizing: border-box;
  border-bottom: 2px solid #eee;
}

#scrollytelling-2 {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Left: scrolly, Right: unit viz */
    gap: 1rem;
    margin-top: 2rem;
    border: 1px solid #ccc;
    padding: 1rem;
}
#scroll-container-2 {
    height: 80vh;
    overflow-y: scroll;
    position: relative;
    border: 1px solid #ccc;
}
#spacer-2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* Height will be set dynamically */
    background: none;
}
#items-container-2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
}
.item-longest {
    position: absolute;
    width: 90%;
    margin: 0 auto;
    background: #f5f5f5;
    border: 2px solid #eee;
    box-sizing: border-box;
    padding: 0.5em;
    border-radius: 4px;
}
#files-longest {
    border: 1px solid #ccc;
    padding: 0.5rem;
    overflow-y: auto;
    max-height: 80vh;
}

/* home page styling */

.profile-container {
    display: flex;
    align-items: center;
    gap: 20px; /* space between image/buttons and text */
}

.image-container {
    display: flex;
    flex-direction: column;
    align-items: center; /* centers both image and buttons */
}

.profile-img {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 5px solid black;
    object-fit: cover;
}

.profile-buttons {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: center; /* centers buttons under the image */
}

.btn {
    padding: 10px 20px;
    background-color: black;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #333;
}

.profile-text {
    font-size: 1.2rem;
    line-height: 1.5;
}
