/* Equation and illustration layout specific to the scaling article. */
.variable-definitions var {
  font-style: normal;
}

.scaling-equation {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.4em;
  margin: 1.5rem 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
}

.variables-figure {
  margin: 1.75rem 0 2rem;
}

.variables-figure__link {
  display: block;
  width: min(100%, 620px);
  cursor: zoom-in;
}

.variables-figure__link:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 6px;
}

.variables-figure figcaption {
  max-width: 520px;
  text-align: center;
}

.section-status span {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border: 1px solid #d8cbb2;
  border-radius: 999px;
  background: #f7f3e9;
  color: #776444;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
}

.math {
  font-family: Georgia, "Times New Roman", serif;
  white-space: nowrap;
}

.math.math-wrap {
  white-space: normal;
}

.compute-equation {
  margin: 1.5rem 0;
  text-align: center;
  color: var(--ink);
  font-size: clamp(1.1rem, 3vw, 1.35rem);
}

.compute-subheading {
  margin: 2rem 0 0.7rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.compute-table-wrap {
  margin: 1.25rem 0;
  overflow-x: auto;
}

.compute-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.compute-table caption {
  caption-side: bottom;
  padding-top: 0.65rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: left;
}

.compute-table th,
.compute-table td {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--line);
}

.compute-table th {
  font-weight: 500;
  color: var(--ink);
}

.compute-table thead {
  background: var(--bg-soft);
}

.compute-figure .figure__surface a {
  display: block;
  width: 100%;
  cursor: zoom-in;
}

/* Highlight the learning objective's question and answer using the site accent. */
.qa-block {
  margin: 1.4rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--accent-mid);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
}

.qa-block__row {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  gap: 0.65rem;
  margin: 0;
}

.qa-block__row + .qa-block__row {
  margin-top: 0.55rem;
}

.qa-block__label,
.qa-block__row strong {
  color: var(--accent-ink);
  font-weight: 600;
}

/* Compact notation, with the symbol key kept beside each definition. */
.definition {
  margin: 1.5rem 0;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
}

.definition__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.definition__title span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}

.definition__equation {
  position: relative;
  margin: 1.3rem 0;
  padding: 0.25rem 1.5rem;
  color: var(--ink);
  font-size: clamp(1.05rem, 3vw, 1.3rem);
}

.definition math,
.compute-equation math {
  font-family: "STIX Two Math", "Cambria Math", math;
}

.definition__number {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.75rem;
}

.definition__terms {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line-2);
  font-size: 0.85rem;
  line-height: 1.6;
}

.definition__terms > div {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 0.75rem;
}

.definition__terms > div + div {
  margin-top: 0.5rem;
}

.definition__terms dt {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
}

.definition__terms dd {
  margin: 0;
}

@media (max-width: 480px) {
  .definition__equation {
    padding-inline: 0;
  }

  .definition__number {
    position: static;
    display: block;
    margin-top: 0.4rem;
    transform: none;
    text-align: right;
  }

  .definition__terms > div {
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.5rem;
  }
}

.mfu-meme {
  width: 50%;
  margin: 1.75rem auto 2rem;
}

.mfu-meme img {
  display: block;
  width: 100%;
  height: auto;
}

.hover-bubble {
  width: min(320px, calc(100vw - 32px));
  box-sizing: border-box;
  white-space: normal;
}

.hover-note:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.check-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15em;
  height: 1.15em;
  border: 1.5px solid var(--accent);
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.85em;
  font-weight: 600;
  line-height: 1;
}

[data-checklist] h3 {
  position: relative;
  padding-left: 1.8em;
}

[data-checklist] h3 > .check-marker {
  position: absolute;
  left: 0;
  top: 0.2em;
}

.toc__number.check-marker {
  margin-top: 0.2em;
}

.hero__meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}

.hero__meta-row .hero__meta {
  margin: 0;
}

.hero__meta--authorship {
  background: #fff0df;
  color: #a64b12;
}

.language-switch {
  display: inline-flex;
  flex: none;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 0.78rem;
  white-space: nowrap;
}

.language-switch a {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}

.language-switch a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.language-switch a:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

html[lang="zh-CN"] .article {
  line-height: 1.9;
  overflow-wrap: break-word;
}

html[lang="zh-CN"] .article h2,
html[lang="zh-CN"] .article h3 {
  line-height: 1.5;
}

.research-score-equation {
  overflow-x: auto;
}

@media (max-width: 600px) {
  html {
    scroll-padding-top: 110px;
  }

  .topnav {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-block: 0.5rem;
  }

  .topnav__links {
    order: 3;
    width: 100%;
  }

  .language-switch {
    margin-left: auto;
  }

  .research-score-equation math {
    font-size: 0.85rem;
  }
}

.repo-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
  margin: 1.4rem 0;
  padding: clamp(1.1rem, 3vw, 1.6rem);
  border: 1px solid #cdd5df;
  border-radius: 14px;
  background: linear-gradient(135deg, #fafbfc, #edf1f5);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.repo-card:hover {
  border-color: var(--accent);
  box-shadow: 0 5px 18px rgb(60 80 110 / 8%);
  text-decoration: none;
}

.repo-card:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 4px;
}

.repo-card__tag {
  padding: 0.25rem 0.65rem;
  border: 1px solid #d1d8e1;
  border-radius: 999px;
  background: #e4e9ef;
  color: #48586c;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
}

.repo-card__name {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.1rem;
  line-height: 1.4;
}

.repo-card__name svg {
  flex: none;
  color: var(--accent-ink);
}

.repo-card__description {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.repo-card__footer {
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 500;
}

.article-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 20px;
  color: #62758c;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.article-stats[hidden] { display: none; }
.article-stats__views, .article-stats__like { display: inline-flex; align-items: center; gap: 7px; }
.article-stats__like {
  padding: 8px 13px;
  border: 1px solid #d4e3f2;
  border-radius: 999px;
  background: #f0f6fc;
  color: #527bad;
  font: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.article-stats__like:hover:not(:disabled) { background: #e2eefb; border-color: #91b2d7; }
.article-stats__like:focus-visible { outline: 2px solid #6c8ebf; outline-offset: 3px; }
.article-stats__like[aria-pressed="true"] { background: #e6effa; cursor: default; }
.article-stats__like[aria-pressed="true"] svg { fill: currentColor; }
.article-stats__like[aria-busy="true"] { opacity: .65; cursor: wait; }
.article-stats__status { flex-basis: 100%; font-size: 12px; }
.article-stats__status:empty { display: none; }

/* Masked asides stay concealed; the shared hover-note script only shows a hint. */
.panda-spoiler {
  border-radius: 3px;
  background-color: #f1f3f5;
  background-image:
    repeating-conic-gradient(#e9edf1 0% 25%, #f5f6f8 0% 50%);
  background-size: 8px 8px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  cursor: help;
}
.panda-spoiler > span { opacity: 0; user-select: none; }
.panda-spoiler:focus-visible { outline: 2px solid #6c8ebf; outline-offset: 3px; }
