/* Elements blog post — from Foundations Blog Post concept */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/geist/geist-sans-400.woff2") format("woff2");
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/geist/geist-sans-500.woff2") format("woff2");
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/geist/geist-sans-600.woff2") format("woff2");
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/geist/geist-mono-400.woff2") format("woff2");
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/geist/geist-mono-500.woff2") format("woff2");
}

.bp {
  margin: 0;
  background: #fafafa;
  color: #1c1d1f;
  font-family: Geist, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

.bp a {
  color: #1c1d1f;
  text-decoration: none;
}

.bp a:hover {
  color: #606168;
}

.bp-skip {
  position: absolute;
  left: -9999px;
}

.bp-skip:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  padding: 8px 12px;
  background: #fff;
  border-radius: 8px;
}

.bp-page {
  min-height: 100vh;
}

.bp-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 250, 250, 0.62);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.075);
}

.bp-header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.bp-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  /* Hang left with the back control so “Foundations” aligns with the series title. */
  margin-left: calc(-1 * min(36px, max(0px, (100vw - 1112px) / 2)));
}

.bp-back {
  display: grid;
  place-items: center;
  width: 28px;
  height: 30px;
  border-radius: 8px;
  color: #606168;
  transition: background 0.12s, color 0.12s, transform 0.12s;
}

.bp-back:hover {
  background: #fff;
  color: #1c1d1f;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.075), 0 1px 2px rgba(0, 0, 0, 0.05);
  transform: translateX(-2px);
}

.bp-prod {
  position: relative;
}

.bp-prod-btn {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font: inherit;
}

.bp-prod-btn:hover {
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.075), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.bp-prod-foundations {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #9b9ca2;
}

.bp-prod-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1c1d1f;
}

.bp-prod-btn svg {
  align-self: center;
  margin-left: 3px;
}

.bp-prod-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.bp-prod-menu {
  position: absolute;
  left: -8px;
  top: calc(100% + 10px);
  width: 250px;
  z-index: 41;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.14);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bp-prod-menu[hidden],
.bp-prod-backdrop[hidden] {
  display: none;
}

.bp-prod-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
}

.bp-prod-item:hover {
  background: #f6f6f7;
}

.bp-prod-item.is-current {
  background: #f2f2f3;
}

.bp-prod-item.is-soon {
  cursor: not-allowed;
  opacity: 0.5;
}

.bp-prod-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: #1c1d1f;
}

.bp-check {
  margin-left: auto;
  font-size: 12px;
  color: #606168;
}

.bp-prod-soon {
  margin-left: auto;
  font: 500 10px "Geist Mono", monospace;
  color: #606168;
  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 999px;
  padding: 0 7px;
}

.bp-prod-item-desc {
  font-size: 12px;
  color: #606168;
}

.bp-header-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.bp-header-link {
  font-size: 13px;
  font-weight: 500;
  color: #606168;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}

.bp-header-link:hover {
  color: #1c1d1f;
  text-decoration: underline;
}

.bp-qr {
  position: relative;
}

.bp-qr-btn {
  appearance: none;
  background: transparent;
  border: 0;
  color: #606168;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  height: 1.5em;
  border-radius: 5px;
  font: inherit;
  line-height: 1;
}

.bp-qr-btn:hover,
.bp-qr-btn[aria-expanded="true"] {
  color: #1c1d1f;
}

.bp-qr-btn svg {
  display: block;
}

.bp-qr-underline {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: -2px;
  height: 2px;
  background: #1c1d1f;
  border-radius: 3px;
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  transition: opacity 130ms ease-in-out, transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.bp-qr-btn:hover .bp-qr-underline,
.bp-qr-btn[aria-expanded="true"] .bp-qr-underline {
  opacity: 1;
  transform: scaleX(1);
}

.bp-qr-pop {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 42;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05), 0 16px 48px rgba(0, 0, 0, 0.12);
  padding: 1.6rem 1.7rem 1.5rem;
}

.bp-qr-pop[hidden] {
  display: none;
}

.bp-qr-pop::before {
  content: "";
  position: absolute;
  top: -0.7rem;
  left: 50%;
  transform: translateX(-50%);
  border: 0.7rem solid transparent;
  border-bottom-color: #fff;
}

.bp-qr-link {
  display: block;
}

.bp-qr-pop img {
  display: block;
  width: 10rem;
  height: 10rem;
  image-rendering: pixelated;
}

.bp-qr-close {
  display: none;
  appearance: none;
  background: transparent;
  border: 0;
  color: #9b9ca2;
  cursor: pointer;
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  padding: 0.4rem;
}

.bp-main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 48px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

.bp-series {
  box-sizing: border-box;
  width: 100%;
  max-width: 1160px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* 40px = back (28) + gap (12); matches header “Foundations” after the back control. */
  padding: 0 0 48px calc(40px - min(36px, max(0px, (100vw - 1112px) / 2)));
}

.bp-series-title {
  align-self: flex-start;
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.bp-series-title .muted {
  color: #9b9ca2;
}

.bp-series-title .on {
  color: #1c1d1f;
}

.bp-series-desc {
  font-size: 14px;
  color: #606168;
}

.bp-hero-copy {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.bp-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font: 11.5px "Geist Mono", monospace;
  color: #9b9ca2;
}

.bp-tag {
  font-weight: 500;
  color: #606168;
  background: #f2f2f3;
  border: 1px solid rgba(0, 0, 0, 0.075);
  border-radius: 999px;
  padding: 1px 10px;
}

.bp-hero-copy h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 50px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-wrap: balance;
}

.bp-dek {
  margin: 0;
  font-size: 20px;
  line-height: 1.55;
  color: #606168;
  text-wrap: pretty;
}

.bp-byline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
}

.bp-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #1c1d1f;
  color: #fff;
  display: grid;
  place-items: center;
  font: 500 11px "Geist Mono", monospace;
}

.bp-byline-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.bp-byline-text strong {
  font-size: 13px;
  font-weight: 500;
}

.bp-byline-text span {
  font-size: 12px;
  color: #9b9ca2;
}

.bp-figure {
  position: relative;
  width: 100%;
  max-width: 1040px;
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
}

.bp-figure:not(.bp-choropleth) {
  aspect-ratio: 2 / 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.075);
  background: #fafafa;
}

.bp-figure:not(.bp-choropleth) img {
  width: min(72%, 520px);
  height: auto;
  max-height: 72%;
  object-fit: contain;
  padding: 0;
  background: transparent;
}

.bp-figure figcaption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* Choropleth Element — unslop two-column: map + quiet paper legend */
.bp-choropleth {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #fafafa;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  padding: 16px;
}

.bp-choropleth-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(220px, 0.7fr);
  gap: 16px;
  align-items: stretch;
}

.bp-choropleth-map-wrap {
  box-sizing: border-box;
  min-width: 0;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
}

.bp-choropleth-map {
  width: 100%;
  height: auto;
  display: block;
  max-height: 520px;
}

.bp-choropleth-map-foot {
  width: 100%;
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bp-choropleth-signature {
  margin: 0;
  font: 500 11px "Geist Mono", monospace;
  letter-spacing: 0.01em;
  color: #737373;
}

.bp-choropleth-credit {
  margin: 0;
  font: 11px "Geist Mono", monospace;
  color: #9b9ca2;
}

.bp-choropleth-credit a {
  color: #606168;
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.18);
  text-underline-offset: 2px;
}

.bp-choropleth-credit a:hover {
  color: #1c1d1f;
}

.bp-choropleth-region {
  cursor: pointer;
  outline: none;
  transition: filter 0.16s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.bp-choropleth-region:hover,
.bp-choropleth-region:focus-visible,
.bp-choropleth-region.is-active {
  filter: brightness(1.05);
}

.bp-choropleth-region:focus-visible {
  stroke: #1c1d1f;
  stroke-width: 3.5;
  paint-order: stroke fill;
}

.bp-choropleth-region.is-selected {
  stroke: #1c1d1f;
  stroke-width: 3.5;
  paint-order: stroke fill;
}

.bp-choropleth-labels text {
  fill: #1c1d1f;
}

.bp-choropleth-label-name.is-on-dark,
.bp-choropleth-label-value.is-on-dark {
  fill: #fff;
}

.bp-choropleth-label-name.is-muted,
.bp-choropleth-label-value.is-muted {
  fill: #606168;
}

.bp-choropleth-legend {
  box-sizing: border-box;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bp-choropleth-legend-kicker {
  font: 500 11px "Geist Mono", monospace;
  letter-spacing: 0.01em;
  color: #737373;
}

.bp-choropleth-measure {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #171717;
}

.bp-choropleth-measure-note {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: #525252;
  text-wrap: pretty;
}

.bp-choropleth-scale {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bp-choropleth-scale li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #171717;
}

.bp-choropleth-swatch {
  width: 36px;
  height: 20px;
  border-radius: 4px;
  background: var(--swatch);
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.bp-choropleth-swatch.is-missing {
  background:
    repeating-linear-gradient(
      -55deg,
      #f0f1f3,
      #f0f1f3 3px,
      #9b9ca2 3px,
      #9b9ca2 5px
    );
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.bp-choropleth-readout {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 80px;
}

.bp-choropleth-readout-label {
  font: 500 11px "Geist Mono", monospace;
  letter-spacing: 0.01em;
  color: #737373;
}

.bp-choropleth-readout strong {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #171717;
}

.bp-choropleth-readout [data-choropleth-readout-value] {
  font-size: 13px;
  color: #525252;
}

.bp-choropleth-table {
  margin-top: 16px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.bp-choropleth-table summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #525252;
  user-select: none;
}

.bp-choropleth-table summary::-webkit-details-marker {
  display: none;
}

.bp-choropleth-table summary::after {
  content: "Show";
  float: right;
  font: 500 11px "Geist Mono", monospace;
  color: #9b9ca2;
}

.bp-choropleth-table[open] summary::after {
  content: "Hide";
}

.bp-choropleth-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.bp-choropleth-table caption {
  text-align: left;
  padding: 0 16px 8px;
  font: 500 11px "Geist Mono", monospace;
  letter-spacing: 0.01em;
  color: #737373;
}

.bp-choropleth-table th,
.bp-choropleth-table td {
  padding: 8px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  text-align: left;
  color: #33343a;
  font-variant-numeric: tabular-nums;
}

.bp-choropleth-table thead th {
  font: 500 11px "Geist Mono", monospace;
  letter-spacing: 0.01em;
  color: #737373;
  background: #fafafa;
}

.bp-choropleth-table tbody th {
  font-weight: 500;
  color: #171717;
}

@media (max-width: 820px) {
  .bp-choropleth {
    padding: 12px;
  }

  .bp-choropleth-stage {
    grid-template-columns: 1fr;
  }

  .bp-choropleth-legend {
    padding: 16px;
  }

  .bp-choropleth-scale {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
  }

  .bp-choropleth-readout {
    grid-column: 1 / -1;
  }
}


.bp-article {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.bp-article p {
  margin: 0;
  font-size: 18px;
  line-height: 1.7;
  color: #33343a;
  text-wrap: pretty;
}

.bp-article p.bp-close {
  color: #1c1d1f;
}

.bp-article a {
  color: #1c1d1f;
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.25);
  text-underline-offset: 3px;
}

.bp-article a:hover {
  color: #606168;
}

.bp-article h2 {
  margin: 18px 0 0;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.bp-article ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bp-article li {
  display: flex;
  gap: 16px;
  font-size: 17px;
  line-height: 1.6;
  color: #33343a;
}

.bp-article li::before {
  content: "–";
  flex: none;
  width: 12px;
  color: #9b9ca2;
  font: 500 14px "Geist Mono", monospace;
  padding-top: 2px;
}

.bp-share {
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.075);
  padding-top: 22px;
  flex-wrap: wrap;
}

.bp-share-label {
  font-size: 13px;
  color: #9b9ca2;
}

.bp-copy {
  font-size: 12.5px;
  border: 1px solid rgba(0, 0, 0, 0.13);
  background: #fff;
  border-radius: 8px;
  padding: 5px 11px;
  cursor: pointer;
  font-family: inherit;
  color: #1c1d1f;
}

.bp-copy:hover {
  background: #f2f2f3;
}

.bp-share-link {
  margin-left: auto;
  font-size: 13px;
  color: #606168;
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.2);
  text-underline-offset: 3px;
}

.bp-more {
  max-width: 1160px;
  margin: 0 auto;
  padding: 60px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bp-more-label {
  font: 500 10.5px "Geist Mono", monospace;
  letter-spacing: 0.06em;
  color: #9b9ca2;
}

.bp-more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.bp-more-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.075);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: inherit;
  transition: box-shadow 0.15s ease;
}

.bp-more-card:hover {
  color: inherit;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.13), 0 8px 24px rgba(0, 0, 0, 0.06);
}

.bp-more-meta {
  display: flex;
  gap: 8px;
  font: 11px "Geist Mono", monospace;
  color: #9b9ca2;
}

.bp-more-card strong {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.bp-more-card span {
  font-size: 13px;
  color: #606168;
  text-wrap: pretty;
}

.bp-footer {
  max-width: 1160px;
  margin: 0 auto;
  padding: 100px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.bp-footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 24px;
  font-size: 13px;
  max-width: 520px;
  border-top: 1px solid rgba(0, 0, 0, 0.075);
  padding-top: 32px;
}

.bp-footer-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.bp-footer-col > span {
  font: 500 10.5px "Geist Mono", monospace;
  letter-spacing: 0.06em;
  color: #9b9ca2;
}

.bp-copy-line {
  font: 11px "Geist Mono", monospace;
  color: #9b9ca2;
}

.bp-index {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
}

.bp-index-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.075);
  color: inherit;
}

.bp-index-card:hover {
  color: inherit;
}

.bp-index-card:hover strong {
  color: #606168;
}

.bp-index-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font: 11px "Geist Mono", monospace;
  color: #9b9ca2;
}

.bp-index-card strong {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.bp-index-card > span {
  font-size: 15px;
  color: #606168;
  text-wrap: pretty;
}

@media (max-width: 720px) {
  .bp-main {
    padding: 32px 24px 32px;
    gap: 28px;
  }

  .bp-series {
    padding-bottom: 24px;
  }

  .bp-figure:not(.bp-choropleth) img {
    padding: 28px;
  }

  .bp-article p,
  .bp-article li {
    font-size: 16px;
  }

  .bp-article h2 {
    font-size: 22px;
  }

  .bp-header-end {
    gap: 12px;
  }

  .bp-qr-pop {
    position: fixed;
    top: 5%;
    left: 15%;
    right: 15%;
    transform: none;
    padding: 3rem;
  }

  .bp-qr-pop::before {
    display: none;
  }

  .bp-qr-close {
    display: block;
  }

  .bp-qr-pop img {
    width: 100%;
    height: auto;
    max-width: 14rem;
    margin: 0 auto;
  }
}
