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


/* ===== Global Layout ===== */
:root {
  /* --color-accent: oklch(65% 50% 0); */
  --color-accent: #004c99;
}

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

body {
  max-width: 100ch;
  margin-inline: auto;
  padding-inline: 1em;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  background: #f8f9fb;
}

/* ===== Navigation Bar ===== */
nav ul,
nav li {
  display: contents;
}

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

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

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: oklch(from var(--color-accent) 95% 5% h); */
  background-color: color-mix(in oklch, var(--color-accent), canvas 85%);
}

/* ===== Contact Form Styling ===== */
input,
textarea,
button {
  font: inherit;
  width: 100%;
  box-sizing: border-box;
}

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

form label {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  gap: 0.5em;
}

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


/* ====== Project Grid Layout ====== */

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

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

/* Reset margin on headings */
.projects h2 {
  margin: 0;
}

.project-info .year {
  color: gray;
  font-family: Baskerville, serif;
  font-variant-numeric: oldstyle-nums;
  margin: 0; /* Optional: to align nicely */
}


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

  overflow: visible;
}

.container {
  display: flex;
  align-items: center;       /* Align chart and legend vertically */
  gap: 1.5em;                /* Space between chart and legend */
  justify-content: flex-start;   /* Center everything horizontally */
  flex-wrap: wrap;           /* Stack on smaller screens */
}

svg {
  width: 100%;              /* Make width responsive */
  height: auto;             /* Allow height to adjust automatically */
  min-height: 600px;        /* Set minimum height to match the chart's height */
  flex-shrink: 0;           /* Prevent shrinking */
}


.legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9em, 1fr));
  border: 1px solid #ccc;
  padding: 1em;
  margin-top: 1em;
  gap: 1em;
  background-color: #fafafa;
  font-family: sans-serif;
  list-style: none;
  flex: 1;
}

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

.swatch {
  display: inline-block;
  width: 1em;
  height: 1em;
  background-color: var(--color);
  border-radius: 0.5em;
}

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

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


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

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

.selected:is(li) {
  font-weight: bold;
  text-decoration: underline;
}


/* Improve overall heading styles */
h1 {
  font-size: 400%;
  line-height: 1.1;
  text-wrap: balance;
  margin: 0.5em 0;
}

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

/* Make sure images scale well */
.projects img {
  width: 100%;
  height: auto;
  object-fit: cover;
}



/* === Resume Page Styles (scoped) === */
/* .resume-page {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  padding: 2em;
  background-color: #fdfdfd;
  color: #333;
  max-width: 800px;
  margin: 0 auto;
}

.resume-page h1 {
  font-size: 400%;
  margin-bottom: 0.2em;
  color: #010508;
  text-align: left;
}

.resume-page section h2 {
  font-size: 2em;
  margin-top: 2em;
  border-bottom: 2px solid #03080c;
  padding-bottom: 0.25em;
  color: #020508;
}

.resume-page h3 {
  font-size: 1.25em;
  margin-bottom: 0.2em;
}

.resume-page time {
  font-size: 0.95em;
  color: #666;
  display: block;
  margin-bottom: 0.5em;
}

.resume-page article ul {
  list-style-type: disc;
  margin-left: 1.5em;
  margin-bottom: 1em;
}

.resume-page p {
  margin-bottom: 1em;
}

.resume-page strong {
  font-weight: bold;
  color: #000;
}

.resume-page section ul {
  list-style-type: square;
  margin-left: 1.5em;
}

@media (max-width: 768px) {
  .resume-page {
    padding: 1em;
  }
} */


/* === Resume Page Styles === */
.resume-page {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  padding: 2em;
  background-color: #fdfdfd; /* Light theme background */
  color: #333; /* Light theme text color */
  max-width: 800px;
  margin: 0 auto;
}

/* When dark theme is active */
body.dark-theme .resume-page {
  background-color: #0d1117; /* Dark theme background */
  color: #c9d1d9; /* Dark theme text color */
}

body.dark-theme .resume-page h1 {
  color: #ffffff; /* Dark theme header color */
}

body.dark-theme .resume-page section h2 {
  color: #ffffff; /* Dark theme section title */
  border-bottom: 2px solid #30363d; /* Dark theme border */
}

body.dark-theme .resume-page strong {
  color: #ffffff; /* Dark theme strong text */
}

body.dark-theme .resume-page time {
  color: #8b949e; /* Dark theme time color */
}


/*=======Theme Dropdown Button=======*/

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


/*========== Git Hub Stats==========*/

/* #profile-stats dl.github-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  gap: 1rem;
  margin-top: 1rem;
}

#profile-stats dt {
  font-weight: bold;
  grid-row: 1;
}

#profile-stats dd {
  margin: 0;
  grid-row: 2;
} */

#profile-stats {
  font-family: 'Arial', sans-serif;
  padding: 1rem;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 800px;
  margin: auto;
}

#profile-stats h2 {
  text-align: center;
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 1rem;
}

#profile-stats dl.github-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

#profile-stats div {
  display: flex;
  flex-direction: column;
  width: 23%; /* Ensure that all items fit in a single row */
  text-align: left;
}

#profile-stats dt {
  font-weight: bold;
  color: #555;
  font-size: 1rem;
  margin-bottom: 0.5rem; /* Adds a little space between dt and dd */
}

#profile-stats dd {
  font-size: 1rem;
  color: #0073e6;
  font-weight: bold;
  margin: 0;
}

/*=======Meta Analysis============*/

.summary {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.summary h2 {
  font-size: 1 rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
}

.stats-grid {
  display: flex;
  gap: 2.5rem;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 1.2rem;
  background: none;
  box-shadow: none;
  border: none;
  padding: 0;
}

.stat {
  background: none !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 0.5rem 0 0;
  min-width: 0;
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
}

.stat .label {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 0;
  margin-right: 0.3em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat .value {
  font-size: 1.1rem;
  font-weight: bold;
  color: #222;
  margin-right: 1.2em;
}

.gridlines line {
  stroke-opacity: 0.5;   /* Make it semi-transparent */
  shape-rendering: crispEdges;
  stroke-width: 1;
  color: #babdc4;
}

.gridlines path {
  display: none;         /* Hide the axis path line */
}


/*=====Step 3=====*/
/* Shared layout for all definition lists with info */
dl.info {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25em 0.75em;
  margin: 0;
  padding: 0.75em 1em;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  border-radius: 0.5em;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  font-family: sans-serif;
  font-size: 0.9rem;
  pointer-events: none;
  transition-duration: 300ms;
  transition-property: opacity, visibility;
  position: fixed;
  z-index: 10;
}

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

/* Tooltip-specific positioning */
.tooltip {
  position: fixed;
  top: 1em;
  left: 1em;
  z-index: 10;
}

/* Smooth scaling on hover */
circle {
  transition: 200ms;
  transform-origin: center;
  transform-box: fill-box;
}

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

/*===Step 5===*/

circle.selected {
  fill: #ff6b6b;
  stroke: black;
  stroke-width: 1px;
}

#language-breakdown {
  margin-top: 1em;
  font-family: sans-serif;
}

#language-breakdown dt {
  font-weight: bold;
  margin-top: 0.5em;
}

#language-breakdown dd {
  margin-left: 1em;
  margin-bottom: 0.5em;
}


/*=====Meta Analysis Lab 8 ======*/
#timeSliderContainer {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
#selectedTime {
  margin-left: auto;
}

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

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

dt {
  grid-column: 1;
}

dt code {
  font-weight: bold;
}

dt small {
  display: block;
  font-size: 0.8em;
  opacity: 0.6;
}

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);
  margin: 0 auto;
  padding: 2rem;
  font-family: system-ui, -apple-system, sans-serif;
  background: #f8f9fb;
}

#stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

#scrollytelling {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

#chart {
  width: 93%;
  height: 300px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
  margin-bottom: 0.1rem;
}

#scroll-container {
  position: relative;
  width: 100%;
  height: 400px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  margin-bottom: 0;
  padding: 1.5rem 1.5rem 1.5rem 1.5rem;
  box-sizing: border-box;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  color: #222;
}

.files {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5em;
  margin-top: 0;
  padding: 1.2rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  height: 400px;
  overflow-y: auto;
}

/* Reduce stats vertical space */
.stat {
  background: #f5f5f5;
  padding: 0.1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.stat .label {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.stat .value {
  font-size: 1.25rem;
  font-weight: bold;
}

/* Layout for commits info and files */
.commits-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

#commit-tooltip {
  position: fixed;
  background: white;
  border: 1px solid #ccc;
  padding: 0.5rem;
  border-radius: 4px;
  pointer-events: none;
  z-index: 1000;
  font-size: 1rem;
}

#selection-info {
  margin-top: 2rem;
  padding: 1rem;
  background: #f5f5f5;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  margin-bottom: 2rem;
}

#language-breakdown {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
}

.line {
  height: 4px;
  margin: 2px 0;
  border-radius: 2px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: #888;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  margin-top: 2.5rem;
  font-weight: 700;
  color: #1a1a1a;
}

.item p {
  margin: 0 0 1.2em 0;
  line-height: 1.7;
  font-size: 1.05rem;
  color: #222;
  word-break: break-word;
}

/* --- Commit text spacing --- */
.item {
  margin-bottom: 1.5em;
  background: none;
  box-shadow: none;
  border: none;
  padding: 0;
}

.item:last-child {
  margin-bottom: 0;
}

/* --- D3 brush overlay inside white block --- */
.overlay {
  fill: #e0e7ef !important;
  opacity: 0.3 !important;
  pointer-events: all;
  border-radius: 12px;
}