/* Layout for meta main content */
.meta-main {
  width: min(1100px, 92%);
  margin-inline: auto;
  padding-block: 3rem 4rem;
}

/* Codebase Meta */
.meta-main h1 {
  font-size: 1.9rem;
  margin-bottom: 0.4rem;
  color: var(--primary);
}

.meta-main > p {
  max-width: 60ch;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* Headings */
.meta-main h2 {
  text-align: center;
  margin: 2.25rem 0 1rem;
  font-size: 1.7rem;
  color: var(--primary); 
}

.meta-main h3 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.1rem;
}

/* Summary stats card */

.stats {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1.25rem;
  background: var(--card);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #eef2ff;
}

.stats dt {
  color: var(--muted);
  font-weight: 600;
}

.stats dd {
  margin: 0;
}

/* Slider “Show commits until bar */

.commit-filter {
  margin: 1.25rem 0 1.75rem;
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius);
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
}

.commit-filter label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.commit-filter input[type='range'] {
  flex: 1;
}

.commit-filter time {
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Scrollytelling layout (left text, right chart card) */

#scrolly-1 {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 2rem;
  align-items: flex-start;
  margin-top: 2rem;
}

/* Left column: story steps */
#scatter-story {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#scatter-story .step {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid #e5e7eb;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  line-height: 1.45;
}

#scatter-story .step p + p {
  margin-top: 0.4rem;
}

#scatter-story .step a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

#scatter-story .step.active {
  border-color: var(--primary);
  box-shadow: 0 14px 32px rgba(30, 64, 175, 0.25);
}

/* Right column: sticky chart + breakdown card */
#scatter-plot {
  position: sticky;
  top: 6.5rem;
  padding: 1.5rem 1.75rem 1.75rem;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  border: 1px solid #eef2ff;
}

/* Toolbar above chart */
.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.chart-toolbar button {
  font-weight: 500;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #d8e0ff;
  background: #f9fbff;
  cursor: pointer;
}

.chart-toolbar button:hover {
  background: #e5edff;
}

/* Make chart SVG responsive */
#chart {
  max-width: 100%;
  overflow: visible;
}

#chart svg {
  width: 100%;
  height: auto;
}

/* Axis + grid styling to match soft look */
.axis-label {
  font-size: 12px;
  fill: var(--muted);
}

.gridlines line {
  stroke: #e5e7eb;
  stroke-opacity: 0.7;
}

/* Dots */
#chart .dots circle {
  transition:
    r 180ms ease-out,
    fill-opacity 150ms ease-out,
    transform 140ms ease-out;
  transform-origin: center;
  transform-box: fill-box;
}

#chart .dots circle:hover {
  transform: scale(1.3);
}

#chart .dots circle.highlight {
  stroke: var(--primary);
  stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(30, 64, 175, 0.55));
}

/* Brush selection, if present */
.selection,
.overlay {
  fill-opacity: 0.12;
}

.handle {
  stroke: var(--ink);
}

/* Tooltip */

dl.info {
  display: grid;
  grid-template-columns: max-content auto;
  gap: 0.25rem 1rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  border: 1px solid #e5e7eb;
}

dl.info dt {
  color: var(--muted);
  font-weight: 600;
}

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

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

/* Language breakdown list */

#language-breakdown {
  margin-top: 1.25rem;
}

#language-breakdown .bar {
  background: var(--primary);
}

/* File changes */

#files {
  margin: 3rem auto 0;
  padding: 1.5rem 1.75rem 1.75rem;
  max-width: 1100px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  border: 1px solid #eef2ff;
  display: grid;
  grid-template-columns: 1.3fr 3fr;
  column-gap: 1.5rem;
  row-gap: 0.35rem;
}

#files > div {
  display: contents; /* dt + dd share the grid */
}

#files dt {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
}

#files dd {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Responsive tweaks */

@media (max-width: 900px) {
  .meta-main {
    padding-block: 2.5rem 3rem;
  }

  #scrolly-1 {
    grid-template-columns: minmax(0, 1fr);
  }

  #scatter-plot {
    position: static;
  }

  #files {
    grid-template-columns: 1fr;
  }
}


/* Monthly calendar */

   #calendar-chart {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
  }
  
  .month-card {
    background: var(--card);
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid #eef2ff;
    padding: 1rem 1.25rem 1.25rem;
  }
  
  .month-card h4 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: var(--primary);
  }
  
  .month-card svg {
    width: 100%;
    height: auto;
    display: block;
  }
  