html {
  --color-accent: #c35063; 
  accent-color: var(--color-accent);
  color-scheme: light dark;

}

.color-scheme {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 80%;
  font-family: inherit;
  padding: 0.3em 0.6em;
  border-radius: 0.5em;
}


body {
    background-color: canvas;
    color: canvastext;
    font-family: "Gaegu", system-ui;
    font: 100%/1.5 "Gaegu";
    max-width: 100ch;
    margin-inline: max(1em, (100% - 100ch) / 2);
    padding: 30px;
  }

nav ul, nav li {
  display: contents;
}

nav {
  display: flex;
}

nav a {
  font-size: 1.2rem;
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: inherit;
  padding: 0.5em;
  border-bottom-width: 1px;
  border-bottom-style: solid;
  /* border-bottom-color: #f8cbd2; */
  border-color: oklch(50% 10% 200 / 40%);

}

nav a.current {
  font-weight: bold;
  border-bottom-width: 0.4em;
}

nav a:hover {
  border-bottom: 0.4em solid var(--color-accent);
  /* background-color: oklch(from var(--color-accent) 95% 5% h); */
  background-color: color-mix(in oklch, var(--color-accent), canvas 85%);

}

/* CONTACT PAGE */

   form {
    background-color: canvas;
    padding: 2em;
    border-radius: 1em;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1em;
  }
  
  input,
  textarea {
    background-color: white;
    color: black;
    border: 1px solid #ccc;
    padding: 0.75em;
    border-radius: 0.5em;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
  }
  
  input:focus,
  textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px oklch(90% 10% 20% / 0.3);
    outline: none;
  }
  
  form label,
  form button {
    grid-column: 1 / -1;
  }
  
  form label {
    display: grid;
    grid-template-columns: subgrid;
    align-items: center;
    gap: 0.5em;
  }
  
  button {
    background-color: var(--color-accent);
    color: white;
    padding: 0.75em 1.5em;
    font-size: 1rem;
    border: none;
    border-radius: 0.5em;
    cursor: pointer;
    transition: background-color 0.3s;
  }
  
  button:hover {
    background-color: oklch(60% 20% 20);
  }

/* HOME PAGE */
.headshot {
  border-radius: 50%;
}

.info {
  text-align: center;
  font-size: 120%;
  line-height: 1.8;
  max-width: 60ch;
  margin: 0 auto;
}

.loc {
  display: flex;
  width: 0.5em;
  aspect-ratio: 1;
  background: var(--color, steelblue);
  border-radius: 50%;
}


/* PROJECTS PAGE */
h1 {
  font-size: 400%;
  margin-bottom: 0.5em;
}

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


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

.projects article {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
  padding: 1em;
  border: 1px solid #ccc;
  border-radius: 0.5em;
  background-color: #EEF1EF;
}

.projects article:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  background-color: #fafafa;
}

.projects h2 {
  margin: 0;
}


.projects img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-block: 0.5em;
}

@media (prefers-color-scheme: dark) {
  .projects article {
    color: black;
  }

  .projects a {
    color: #3e1e99; 
  }
}

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

  overflow: visible;
}

.container {
  display: flex;
  gap: 3em;
  align-items: center; 
  justify-content: center;
  /* margin-block: 2em; */
  flex-wrap: wrap; 
}

.legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9em, 1fr));
  /* gap: 1em; space between items in the grid */
  border: 1px solid #ccc;
  padding: 1em;
  background-color: #f9f9f9;
  /* list-style: none; */
  /* margin-top: 2em; */
  flex: 1;

}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5em; /* space between swatch and label */
  font-size: 1.2em;
}

.legend-item .swatch {
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: var(--color);
  border-radius: 50%;
  flex-shrink: 0;
}

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

svg path {
  fill: var(--color);
  transition: 300ms;
  cursor: pointer;
}

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


.legend-item.selected {
  font-weight: bold;
}

.legend-item.selected .swatch {
  --color: oklch(60% 45% 0) !important;
  background-color: var(--color);
  width: 1em;
  height: 1em;
}

/* RESUME PAGE */
.cv section {
  background-color: #EEF1EF;

  padding: 2em;
  border: 1px solid #ddd;
  border-radius: 0.75em;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 2em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cv section:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.cv section h2 {
  border-bottom: 3px solid #7D98A1;
  padding-bottom: 0.3em;
  margin-bottom: 1em;
  color: #7D98A1;
}

.cv article {
  margin-bottom: 1.5em;
}

.cv article img {
  max-width: 150px;
  display: block;
  margin: 1em 0;
}


.cv article h3 {
  margin-top: 0.5em;
}

.cv article p time {
  color: #666;
  font-size: 0.95rem;
}

/* Skills list inside card */
.cv section:last-of-type ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15ch, 1fr));
  gap: 0.5em 1.5em;
  list-style: none;
  padding-left: 0;
}

.cv section:last-of-type ul li::before {
  content: "• ";
  color: var(--color-accent);
}

@media (prefers-color-scheme: dark) {
  .cv article {
    color: black;
  }

  .cv-skills {
    color: black;
  }
}


/* GITHUB STATS */
#profile-stats dl {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 equal columns */
  gap: 1.5rem;
  text-align: center;
  font-family: 'Gaegu', cursive;
  margin: 2rem 0;
}

#profile-stats dt {
  grid-row: 1;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #6c7280; /* soft gray */
  letter-spacing: 1px;
}

#profile-stats dd {
  grid-row: 2;
  font-size: 2rem;
  margin: 0;
  font-weight: bold;
  color: #111;
}

/* META */


#stats {
  margin-top: 2rem;
  max-width: 700px;
  display: flex;
  justify-content: center;
}


.stats {
  display: grid;
  grid-template-columns: auto 1fr;
  row-gap: 1rem;
  column-gap: 2rem;
}

.stats dt {
  text-align: left;
  color: #777;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stats dd {
  margin: 0;
  font-weight: bold;
  font-size: 1.4rem;
  text-align: left;
}


.gridlines line{
  stroke: #ccc;
  stroke-opacity: 0.5;
  shape-rendering: crispEdges;
}

.gridlines path {
  display: none;
}

/* Layout for info lists */
dl.info {
  display: grid;
  gap: 0.25rem 0.75rem;
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  position: fixed;
  top: 1em;
  left: 1em;
  backdrop-filter: blur(4px);
  transition-duration: 500ms;
  transition-property: opacity, visibility;
}

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

/* Circle hover styling */

circle.selected {
  fill: #ff6b6b;
}

#commit-tooltip {
  pointer-events: none;
}

.tooltip {
  position: fixed;
  top:1em;
  left:1em;
}

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 {
  transition: all 0.3s ease;
  transition: all 200ms, r calc(var(--r) * 100ms);
} */

.commit-slider-container {
  display: flex; 
  flex-direction: column; 
  gap: 1rem; 
  margin-bottom: 1em;
}

.commit-progress {
  display: flex; 
  align-items: center; 
  gap: 1rem;
}

circle {
  transition: all 200ms, r calc(var(--r, 1) * 100ms);
  /* transition: all 0.3s ease; */

  fill: steelblue;
  fill-opacity: 0.5;

}

@starting-style {
  circle {
    r: 0; 
  }
}


.files {
  display: grid;
  grid-template-columns: 1fr 4fr;
  gap: 0.25em 1em;
  margin-top: 1em;
  padding-left: 0;
}

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

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

.files dd {
  grid-column: 2;
  margin-left: 0;
}


.line {
  display: flex;
  width: 0.5em;
  aspect-ratio: 1;
  transition: background 0.3s ease;
  border-radius: 50%;
}

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

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

/* SCROLLYTELLING */

.scrollytelling-files {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-top: 2rem;
}

/* Left side (unit visualization) */
#files-viz {
  flex: 1;
  position: sticky;
  top: 2rem;
  max-height: 90vh;
  overflow-y: auto;
}

/* Right side (scroll steps) */
#files-story {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Style each step */
#files-story .step {
  background: white;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  line-height: 1.5;
}


#scrolly-1 {
  position: relative;
  display: flex;
  gap: 1rem;

  > * {
    flex: 1;
  }
}

#scatter-story {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

#scatter-story .step {
  background: white;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  line-height: 1.5;
}


#scatter-plot {
  position: sticky;
  top: 0;
  left: 0;
  bottom: auto;
  height: 50vh;
}

#chart {
  grid-column: 2;
}

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

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

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

.github-stats {
  text-align: center;
  margin: 50px 0;
}

.github-stats h2 {
  font-size: 2em;
  margin-bottom: 30px;
}

.stats-container {
  display: flex;
  justify-content: center;
  gap: 80px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.label {
  font-weight: bold;
  font-size: 1.1em;
  letter-spacing: 1px;
  color: #6e7480;
}

.value {
  font-size: 2.5em;
  margin-top: 10px;
  font-weight: bold;
}
