/* GENERAL */

@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap');


* {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Figtree", sans-serif;
    margin: 0;
    padding: 20px;
}

/* Page layout to match main site */

/* Central layout wrapper */
.page-wrapper {
  margin: 0 auto;
  padding: 0 2rem;
  max-width: 1200px;
  box-sizing: border-box;
}

/* Apply this to main containers */
.back-button-container,
.chart-wrapper {
  margin: 0 auto;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.page-content {
    margin: 0 10rem;
    padding-top: 4vh;
    min-height: 96vh;
    box-sizing: border-box;
}

h1 {
    color: oklch(66.19% 0.0723 146.59);
    text-align: center;
    font-size: 3.5rem;
}

h2.experience-sub-title {
    color: oklch(70.31% 0.0723 146.59)
}

html {
    scroll-behavior: smooth;
}

p {
    color: rgb(85, 85, 85);
}


/* Back button */
.back-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #333;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    margin: 2rem 2rem 0 2rem; /* Added margin: top, right, bottom, left */
}

.btn-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.btn {
    font-weight: 600;
    transition: all 300ms ease;
    padding: 1rem 1.5rem;
    min-width: 8rem;
    border-radius: 2rem;
    white-space: nowrap;
    border: oklch(70.31% 0.0723 146.59) 0.1rem solid;
}



.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
  gap: 2rem;
  margin: 2rem 10rem;
  padding: 2rem 0;
  max-width: 1200px;
}

.projects article {
  display: flex;
  flex-direction: column;
  margin: 0;
  background: white;
  border-radius: 2rem;
  border: oklch(60.31% 0.0723 146.59) 0.1rem solid;
  border-color: rgb(163, 163, 163);
  padding: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
  position: relative;
}

.projects article:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-color: #82AC85;
  cursor: pointer;
}

.projects article:hover h2 a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, #82AC85, transparent);
  animation: slideIn 0.3s ease;
}

.projects article h2 {
  margin: 0 0 0.8rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  color: #82AC85;
  line-height: 1.3;
}

.projects article img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 1rem;
  margin-bottom: 0.8rem;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.projects article:hover img {
  transform: scale(1.02);
}



h2 {
  font-size: 1.8rem;
  color: #82AC85; 
  font-weight: bold;
  margin-bottom: 1.5em;
}

h3, h4 {
  font-size: 1.4rem;
  color: #333;
}

.subtext {
  font-size: 1rem;
  color: #666;
  margin-top: -1em;
  line-height: 1.5;
  font-style: italic;
}

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

}

.profile-stats {
  text-align: center;
  margin-top: 20px;
}

.profile-stats h2 {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
}

.profile-stats dl {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 equal-sized columns */
  text-align: center;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
}

.profile-stats dt {
  font-size: 14px;
  font-weight: bold;
  color: gray;
  text-transform: uppercase;
  grid-row: 1; /* Place dt elements in the first row */
}

.profile-stats dd {
  font-size: 32px;
  font-weight: bold;
  margin: 0;
  grid-row: 2; /* Place dd elements in the second row */
}

.chart-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 10rem;
  padding: 2rem 0;

}

.container {
  display: flex;
  align-items: flex-start;
  gap: 2em;
  margin: 1em 0;
  width: 100%;
  flex-wrap: wrap;
  border-radius: 1rem;

}

#projects-pie-plot {
  max-width: 20em;
  margin: 0;
  overflow: visible;
  flex: 1 1 200px;
  background: none;
  box-shadow: none;
}

#projects-pie-plot path:nth-of-type(1) { fill: #A8D5BA; }  /* pastel green */
#projects-pie-plot path:nth-of-type(2) { fill: #FFE29A; }  /* pastel yellow */
#projects-pie-plot path:nth-of-type(3) { fill: #FFB3AB; }  /* pastel coral-pink */
#projects-pie-plot path:nth-of-type(4) { fill: #B5C7E3; }  /* pastel slate blue */
#projects-pie-plot path:nth-of-type(5) { fill: #AED9E0; }  /* pastel aqua blue */



.legend {
  list-style: none;
  padding: 1em;
  margin: 1em 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  border-radius: 4px;
  flex: 2 1 200px;
  min-width: 15em;
  box-sizing: border-box;
  flex-direction: column;
  align-items: flex-start;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5em;
  min-width: fit-content;
}

.swatch {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  background-color: var(--color);
  border-radius: 50%;
  vertical-align: -0.2em;
  margin-right: 0.5em;
}

.legend li {
  margin-bottom: 1em;
}

.legend .swatch {
  margin-right: 0.8em;
}

.legend li em {
  font-size: 1em;
}

.legend li span.year-label {
  font-size: 1.4em;
  font-weight: bold;
  margin-right: 0.5em;
  vertical-align: middle;
}



.search-container {
  margin: 1em 0;
  text-align: center;
}

.searchBar {
  display: block;
  width: 100%;
  max-width: 700px;
  margin: 2rem auto;
  padding: 1em;
  font-size: 1.2em;
  border: 1px solid #ccc;
  border-radius: 20px;
  box-sizing: border-box;
}

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

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

.selected {
  --color: oklch(70.31% 0.0723 146.59) !important;

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

/* Container styles */

/* Chart styles */
#chart {
  width: 100%;
  max-width: 1000px;
  margin: 2em auto;
}

svg {
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.dots circle {
  opacity: 0.6;
}

.gridlines line {
  stroke: #ddd;
  stroke-width: 1px;
}

.gridlines path {
  display: none;
}

/* Container for the entire stats section */
#stats {
  margin: 2em auto;
  max-width: 800px;
  padding: 0 20px;
}

/* Make the definition list a flex container */
.stats {
  display: flex;
  flex-wrap: wrap;        /* Allows wrapping if the screen is narrow */
  justify-content: space-around;
  margin: 0;              /* Remove default DL margins */
  padding: 0;
}

/* Each stat block (one label + one value) */
.stat-block {
  display: flex;
  flex-direction: column; /* dt on top, dd below */
  align-items: center;    /* Center them horizontally */
  margin: 1em 0;
  flex: 1 1 100px;        /* Adjust so they size nicely */
  text-align: center;     /* Center text in each block */
}

/* The label (dt) styling */
.stat-block dt {
  font-weight: 500;
  color: #666;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5em;
}

/* The numeric/value (dd) styling */
.stat-block dd {
  margin: 0;
  color: #333;
  font-size: 2rem;
  font-weight: 600;
}



/* Axis styles */
.axis text {
  font-size: 12px;
  color: #666;
}

.axis line {
  stroke: #ddd;
}

.axis path {
  stroke: #ddd;
}

dl.info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5em 1em;
  margin: 0;
  padding: 0.5em;
  transition-duration: 500ms;
  transition-property: opacity, visibility;
}

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

dl.info dt {
  color: #666;
  font-weight: normal;
  text-align: right;
}

dl.info dd {
  margin: 0;
  font-weight: 500;
}

.tooltip {
  position: fixed;
  top: 1em;
  left: 1em;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms;
}

/* Show tooltip when it has content */
.tooltip:has(a[href]) {
  opacity: 1;
}
/* Circle hover effects */
circle {
  transition: all 200ms, r calc(var(--r) * 100ms);
  transform-origin: center;
  transform-box: fill-box;
  cursor: pointer;
}

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

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

@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 {
  margin: 1em auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  justify-content: center;
  max-width: 800px;
}

#language-breakdown dt,
#language-breakdown dd {
  display: inline;
  margin: 0;
}

#language-breakdown dt {
  font-weight: 600;
  margin-right: 0.5em;
}

#language-breakdown dt::after {
  content: ":";
}

#language-breakdown dt,
#language-breakdown dd {
  padding: 0.5em 1em;
  border-radius: 4px;
}

#selection-count {
  font-size: 1.1em;
  margin: 1em 0;
  text-align: center;
}

#time-control {
  display: flex;
  align-items: baseline;
  margin-bottom: 1rem;
}

#time-control label {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex: 1;
}

#max-time {
  margin-left: auto;
}

#time-slider {
  flex: 1;
  min-width: 200px;
}

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

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

.files dt {
  grid-column: 1;
}

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

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

/* Add to your CSS file */
.scrolly-container {
  display: flex;
  flex-direction: row;
  min-height: 600px;
  margin: 3rem 0;
}

.vis-container {
  flex: 1;
  position: sticky;
  top: 50px;
  height: 600px;
  overflow: auto;
}

.scroll-container {
  flex: 1;
  height: 600px;
  overflow-y: auto;
  position: relative;
}

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

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

.files-viz dt {
  grid-column: 1;
}

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



.projects article .project-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.projects article .project-info p {
  margin: 0;
  color: #555;
  line-height: 1.6;
  font-size: 0.95rem;
}

.projects article .project-info p:first-child {
  flex: 1;
}

.projects article .project-year {
  font-weight: 600;
  color: #82AC85 !important;
  font-size: 0.85rem !important;
  padding: 0.2rem 0.6rem;
  background: rgba(130, 172, 133, 0.1);
  border-radius: 1rem;
  text-align: center;
  margin-top: auto !important;
  width: fit-content;
  align-self: center;
}

/* Enhanced link styling */
.projects article h2 a {
  color: inherit;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.projects article h2 a:hover {
  color: #82AC85;
  text-decoration: none;
}

.projects article h2 a:visited {
  color: inherit;
}

.projects article h3 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.projects article h3 a:hover {
  color: #82AC85;
  text-decoration: underline;
}

.projects article h3 a:visited {
  color: inherit;
}

/* Make .projects > a behave like a grid item and style as card */
.projects > a {
  display: flex;
  flex-direction: column;
  margin: 0;
  background: white;
  border-radius: 2rem;
  border: oklch(60.31% 0.0723 146.59) 0.1rem solid;
  border-color: rgb(163, 163, 163);
  padding: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
  position: relative;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.projects > a:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-color: #82AC85;
}

.projects > a:hover h2::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, #82AC85, transparent);
  animation: slideIn 0.3s ease;
}

.projects > a h2 {
  margin: 0 0 0.8rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  color: #82AC85;
  line-height: 1.3;
  position: relative;
}

/* Hide pointer on nested article for non-links */
.projects article {
  cursor: default;
}

svg path.selected {
  fill: #4B7F5A !important; /* darker green */
  stroke: none;
  filter: none;
}

.legend li.selected .swatch {
  background-color: #4B7F5A !important;
}