/* Portfolio styles layered on top of the Chirpy theme. Colors reuse Chirpy variables so light/dark both work. */

/* ---------- Landing ---------- */

#main-wrapper main > article.pf {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 0 3rem;
  color: var(--text-color);
  line-height: 1.8;
}

.pf a {
  color: var(--link-color);
  border-bottom: none !important;
  text-decoration: none;
}

.pf a:hover {
  text-decoration: underline;
}

.pf-intro {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.pf-photo {
  flex: 0 0 96px;
  height: 96px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.pf-name {
  margin: 0;
  color: var(--heading-color);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
}

.pf-affil {
  margin: 0.2rem 0 0;
  color: var(--text-muted-color);
}

.pf-bio p {
  margin-bottom: 1rem;
}

.pf-contact span {
  margin: 0 0.35rem;
  color: var(--text-muted-color);
}

.pf-section {
  margin-top: 2.75rem;
}

.pf-section h2 {
  margin: 0 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--main-border-color);
  color: var(--heading-color);
  font-size: 1.15rem;
  font-weight: 700;
}

.pf-item {
  margin-bottom: 1.5rem;
}

.pf-item p {
  margin: 0;
}

.pf-item-title {
  color: var(--heading-color);
  font-weight: 600;
}

.pf-item-meta,
.pf-muted {
  color: var(--text-muted-color);
}

.pf-item-meta {
  font-size: 0.92rem;
}

.pf-item-desc {
  margin-top: 0.35rem !important;
}

.pf-item-links a {
  margin-right: 0.9rem;
  font-size: 0.92rem;
}

.pf-small {
  font-size: 0.85rem;
}

.pf-pubs {
  padding-left: 1.1rem;
  margin: 0;
}

.pf-pubs li {
  margin-bottom: 0.8rem;
}

.pf-pubs b {
  color: var(--heading-color);
}

.pf-notes {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pf-notes li {
  display: flex;
  gap: 1rem;
  padding: 0.2rem 0;
}

.pf-notes time {
  flex: 0 0 4.5rem;
  color: var(--text-muted-color);
}

/* ---------- Tab pages (projects, about) ---------- */

.content img[src*='/assets/img/projects/'] {
  display: block;
  max-width: min(100%, 820px);
  margin: 0 auto;
  border-radius: 6px;
  background: #fff;
  padding: 0.5rem;
}

.content a.popup:has(img[src*='/assets/img/projects/']) {
  background: transparent !important;
}

html[data-mode='dark'] .content img[src*='/assets/img/projects/'] {
  filter: brightness(0.9);
}

@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .content img[src*='/assets/img/projects/'] {
    filter: brightness(0.9);
  }
}

/* ---------- Cumulative return chart (projects) ---------- */

.rbl-chart {
  --rbl-s1: #2a78d6;
  --rbl-s2: #eb6834;
  --rbl-s3: #1baf7a;
  --rbl-b1: #52514e;
  --rbl-b2: #a3a29c;
  --rbl-grid: #e9e8e3;
  --rbl-base: #c3c2b7;
  --rbl-ink: #898781;
  position: relative;
  max-width: 820px;
  margin: 1.5rem auto 0.5rem;
}

html[data-mode='dark'] .rbl-chart {
  --rbl-s1: #3987e5;
  --rbl-s2: #d95926;
  --rbl-s3: #199e70;
  --rbl-b1: #c3c2b7;
  --rbl-b2: #6f6e69;
  --rbl-grid: #2c2c2a;
  --rbl-base: #4a4a46;
}

@media (prefers-color-scheme: dark) {
  html:not([data-mode]) .rbl-chart {
    --rbl-s1: #3987e5;
    --rbl-s2: #d95926;
    --rbl-s3: #199e70;
    --rbl-b1: #c3c2b7;
    --rbl-b2: #6f6e69;
    --rbl-grid: #2c2c2a;
    --rbl-base: #4a4a46;
  }
}

.rbl-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.rbl-grid {
  stroke: var(--rbl-grid);
  stroke-width: 1;
}

.rbl-base {
  stroke: var(--rbl-base);
  stroke-width: 1;
}

.rbl-cross {
  stroke: var(--rbl-base);
  stroke-width: 1;
}

.rbl-tick {
  fill: var(--rbl-ink);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.rbl-end {
  fill: var(--text-color);
  font-size: 11.5px;
}

.rbl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0 !important;
  font-size: 0.85rem;
}

.rbl-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 !important;
}

.rbl-legend span,
.rbl-tip span {
  display: inline-block;
  width: 12px;
  height: 3px;
  border-radius: 2px;
}

.rbl-chart figcaption {
  margin-top: 0.5rem;
  color: var(--text-muted-color);
  font-size: 0.82rem;
  text-align: left;
}

.rbl-tip {
  position: absolute;
  top: 8px;
  z-index: 2;
  min-width: 190px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--main-border-color);
  border-radius: 6px;
  background: var(--main-bg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  font-size: 0.8rem;
  line-height: 1.6;
  pointer-events: none;
}

.rbl-tip div {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.rbl-tip b {
  margin-left: auto;
  padding-left: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.rbl-table {
  max-width: 820px;
  margin: 0.5rem auto 1rem;
  font-size: 0.9rem;
}

.rbl-table summary {
  cursor: pointer;
  color: var(--link-color);
}

.rbl-table table {
  margin-top: 0.6rem;
  font-variant-numeric: tabular-nums;
}

.rbl-table p {
  margin-top: 0.5rem;
  color: var(--text-muted-color);
  font-size: 0.82rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 575px) {
  .rbl-tick {
    font-size: 18px;
  }

  .rbl-end {
    display: none;
  }

  .pf {
    padding-top: 1rem;
  }

  .pf-intro {
    gap: 1rem;
  }

  .pf-photo {
    flex-basis: 72px;
    height: 72px;
  }

  .pf-name {
    font-size: 1.6rem;
  }

  .pf-notes li {
    flex-direction: column;
    gap: 0;
  }

  .pf-notes time {
    flex-basis: auto;
    font-size: 0.85rem;
  }
}
