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

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; 
    margin-inline: auto;
    padding: 2rem;
    max-width: min(120ch, 80vw);

  }


.profile-pic {
  width: 17rem;

}

nav {
  display: flex;
  margin-bottom: 1.5rem;
  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);
  /* background-color: color-mix(in oklch, var(--color-accent), canvas 85%); */
}

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

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

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


input, textarea, button {
  font: inherit; 
}


label {
  margin-block: 0.5rem; 
  display: contents;
  grid-column: 1 / -1;
}

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

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


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

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

h2 {
  margin: 0;
  font-size: 180%;
  margin-bottom: 1ch;
}

h1 {
  font-size: 400%;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.1;
  margin-top: 1ch;
}




time {
  font-style: italic;
  color: #666;
}

section {
  border-bottom: 1px solid #ddd;
}

section a {
  color: #333333;
}

.tech-stack {
  font-size: 0.95rem;
  font-style: italic;
  color: #555;
}

.project-header {
  display: flex;
  align-items: baseline; 
  gap: 6px;
}

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


/* #profile-stats {
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  border: 1px solid #ddd;
  border-radius: 12px;
  background-color: #fafafa;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
} */

#profile-stats h2 {
  text-align: left;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  color: #ddd;
}

.stats-grid {
  display: flex;
  justify-content: space-between; /* Spread out items across the row */
  gap: 1.5rem;
}

.stats-grid dt {
  grid-row: 1; /* Place <dt> elements in the first row */
  font-weight: bold;
  text-align: right;
  font-size: 1.1rem;
  color: #555;
}

.stats-grid dd {
  grid-row: 2; /* Place <dd> elements in the second row */
  font-size: 1.1rem;
  text-align: left;
  color: #333;
}

.project img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  max-height: 150px; /* Reduced from 200px */
  width: 300px; /* Added fixed width */
  margin: 0 auto; /* Center the image */
  display: block; /* Ensure proper centering */
}

#projects-pie-plot {
  max-width: 20em;
  margin-block: 2em;

  overflow: visible;
}

/* .legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9em, 1fr));
  gap: 1rem;
  padding: 1rem;
  margin: 0;
  list-style: none;
  flex: 1;
  border-radius: 8px;

}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-family: sans-serif;
}

.legend-item .swatch {
  width: 1em;
  aspect-ratio: 1 / 1;
  background-color: var(--color);
  border-radius: 10px;
  display: inline-block;
}

.container {
  display: flex;
  align-items: flex-start;
  gap: 2rem; 
  padding: 1rem;
  border: 1px solid #ddd;
  margin-top: 2rem;
  max-width: 100%;
  flex-wrap: wrap; 
} */

.container {
  display: flex;
  align-items: flex-start;     /* Align chart and legend to top */
  gap: 2rem;                   /* Space between pie and legend */
  padding: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;             /* Allows wrapping on smaller screens */
}

svg {
  width: 300px;
  height: 300px;
  flex-shrink: 0;              /* Prevent SVG from shrinking */
}

.legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9em, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 1rem;
  margin: 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  /* background-color: #f9f9f9; */
  flex: 1;                     /* Take up remaining width */
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.swatch {
  width: 1em;
  aspect-ratio: 1 / 1;
  background-color: var(--color);
  border-radius: 4px;
  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);
  }
}


.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 2rem;
  /* max-width: 1000px; */
  margin: 0 auto;
}

.stats dt {
  text-transform: uppercase;
  font-size: 0.75rem;
  color: #6b7280; 
  margin-bottom: 0.25rem;
}

.stats dd {
  font-size: 2rem;
  font-weight: bold;
  margin: 0;
}

dl.stats {
  margin: 0;
}

.gridlines line {
  stroke: #d1d5db; /* light gray (Tailwind gray-300) */
  stroke-opacity: 0.5;
  shape-rendering: crispEdges;
}

.gridlines path {
  display: none; /* hides the domain path */
}


dl.info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 1rem;
  /* max-width: 320px; */
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  font-family: sans-serif;
  font-size: 0.875rem;

  transition-duration: 500ms;
  transition-property: opacity, visibility;

  background-color: rgba(255, 255, 255, 0.85); /* semi-transparent white */
  border-radius: 0.5rem; /* rounded corners */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* soft shadow */
  backdrop-filter: blur(8px); /* frosted glass effect */
}

dl.info dt {
  margin: 0;
  font-weight: bold;
  color: #6b7280; /* Tailwind gray-500 */
  font-size: 0.75rem;
  text-transform: uppercase;
}

dl.info dd {
  margin: 0;
  font-weight: normal;
  color: #111827; /* Tailwind gray-900 */
}

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

.tooltip {
  position: fixed;
  top: 1em;
  left: 1em;
  z-index: 100;
}

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

  @starting-style {
    r: 0;
  }
}

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

circle.selected {
  fill: #ff6b6b;
}


#language-breakdown {
  display: flex;
  /* gap: 2rem;
  margin-top: 1rem; */
  padding: 1rem 0;
  justify-content: start;
  flex-wrap: wrap;
  font-family: monospace;
}




#chart svg {
  width: 100%;
  max-width: none;
  height: auto;
  display: block;
}



#commitFilterUI {
  display: flex;
  align-items: baseline;
  gap: 1em;
  margin-bottom: 1em;
}

#selectedTime {
  margin-left: auto;
}

#commitSlider {
  flex: 1;
  max-width: 600px; 
}



.line {
  width: 0.5em;
  aspect-ratio: 1;
  border-radius: 50%;
  flex: 0 0 auto;  /* prevents squishing/stretching */
}



.files {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.files > div {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
}

.files dt {
  grid-column: 1;
  font-weight: bold;
  color: #666;
}

.files dt code {
  font-family: monospace;
  background: #f5f5f5;
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

.files dt small {
  display: block;
  font-size: 0.8em;
  opacity: 0.7;
  margin-top: 0.2em;
}

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

.line {
  display: flex;
  width: 0.5em;
  aspect-ratio: 1;
  border-radius: 50%;
}



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

#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: 160px;
  padding: 10px;
  box-sizing: border-box;
  border-bottom: 2px solid #eee;
}



#scroll-container-files {
  height: 350px;
  overflow-y: auto;
  position: relative;
  border: 1px solid #ccc;
  margin-top: 2rem;
}

#spacer-files {
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
}

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

.item-file {
  height: 160px;
  padding: 10px;
  box-sizing: border-box;
  border-bottom: 1px solid #eee;
}

#scrollytelling-files {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  margin-top: 2rem;
}

#files-chart {
  grid-column: 1;
}

#files-scroll-container {
  grid-column: 2;
  position: relative;
  width: 95%;
  height: 250px; /* Reduced from 350px */
  overflow-y: scroll;
  border: 1px solid #ccc;
  margin-bottom: 50px;
}

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

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

.files-item {
  height: 120px; /* Reduced from 160px */
  padding: 10px;
  box-sizing: border-box;
  border-bottom: 2px solid #eee;
}
