:root {
  --code-bg: #1d1d1b;
  --code-text: #eeeeea;
  --note-bg: #f3f3ef;
  --note-border: #858581;
  --draft-bg: #f7f5ec;
  --draft-border: #8a7950;
}

.article-nav {
  position: sticky;
  z-index: 20;
  top: 0;
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: rgba(251, 251, 248, 0.96);
  box-shadow: none;
  font-size: 13px;
  font-family: var(--font-ui);
  font-weight: 500;
}

.article-nav a {
  padding: 0;
  border-radius: 0;
}

.article-nav a:hover {
  background: transparent;
}

.article-page {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 78px 0 120px;
}

.article-header {
  position: relative;
  margin-bottom: 42px;
  text-align: left;
}

.article-header::before {
  width: 48px;
  height: 2px;
  margin-bottom: 22px;
  display: block;
  border-radius: 0;
  background: var(--accent);
  content: "";
}

.article-kicker {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.article-kicker span {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #746233;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.article-header h1 {
  max-width: 750px;
  margin: 0 0 22px;
  color: #191919;
  font-family: var(--font-body);
  font-size: clamp(43px, 7vw, 62px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.01;
}

.article-deck {
  max-width: 700px;
  margin: 0 0 20px;
  color: #202326;
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.58;
}

.article-byline {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
}

.draft-banner,
.callout,
.end-note {
  margin: 30px 0;
  padding: 18px 20px;
  border: 1px solid #d8d2be;
  border-left: 4px solid var(--draft-border);
  border-radius: 0;
  background: var(--draft-bg);
  box-shadow: none;
  font-size: 14px;
}

.toc {
  margin: 42px 0 56px;
  overflow: hidden;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-family: var(--font-ui);
}

.toc summary {
  padding: 15px 0;
  color: #333;
  cursor: pointer;
  font-weight: 650;
}

.toc nav {
  padding: 0 0 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 30px;
}

.toc a {
  padding: 3px 0;
  font-size: 14px;
}

.article-content section {
  padding-top: 35px;
}

.article-content h2 {
  margin: 0 0 18px;
  color: #202020;
  font-family: var(--font-body);
  font-size: 31px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.22;
  text-transform: none;
  scroll-margin-top: 96px;
}

.article-content h2::after {
  display: none;
}

.article-content h3 {
  margin: 32px 0 12px;
  color: #292929;
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.article-content p,
.article-content li {
  color: #17191b;
  font-size: 17px;
  line-height: 1.72;
}

.article-content p {
  margin: 0 0 16px;
}

.article-content li {
  margin-bottom: 7px;
}

.article-content strong {
  color: #242424;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
  padding: 2px 5px;
  border-radius: 2px;
  background: #ecece8;
  color: #303638;
  font-size: 0.88em;
}

pre {
  max-width: 100%;
  margin: 22px 0 30px;
  padding: 22px;
  overflow-x: auto;
  border: 1px solid #30302e;
  border-radius: 2px;
  background: var(--code-bg);
  box-shadow: none;
  color: var(--code-text);
  font-size: 13px;
  line-height: 1.7;
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.code-comment {
  color: #8fb39b;
}

.fill-in {
  margin: 20px 0 28px;
  padding: 19px 21px;
  border: 1px dashed var(--note-border);
  border-radius: 0;
  background: var(--note-bg);
}

.fill-in-label {
  margin-bottom: 9px !important;
  color: var(--muted) !important;
  font-size: 11px !important;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-ui);
}

.spec-grid {
  margin: 24px 0 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--rule);
  font-family: var(--font-ui);
}

.spec-grid div {
  min-height: 82px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.spec-grid span {
  margin-bottom: 6px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.spec-grid strong {
  font-size: 14px;
  font-weight: 560;
}

.figure-placeholder {
  margin: 32px 0;
}

.figure-placeholder > div {
  min-height: 280px;
  display: grid;
  place-items: center;
  border: 1px dashed #b6bfce;
  border-radius: 0;
  background: #f3f3ef;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.figure-placeholder.compact > div {
  min-height: 180px;
}

.figure-placeholder figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  font-family: var(--font-ui);
}

.article-figure {
  width: 100%;
  margin: 32px 0;
  display: grid;
  justify-items: center;
  text-align: center;
}

.article-figure img {
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  display: block;
  border: 3px solid #42474a;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.article-figure figcaption {
  max-width: 720px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  font-family: var(--font-ui);
}

.equation {
  margin: 22px 0;
  padding: 19px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  color: #343434;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  line-height: 1.9;
  text-align: center;
}

.callout {
  border-color: #d7d7d1;
  border-left-color: var(--note-border);
  background: var(--note-bg);
  box-shadow: none;
}

.callout.warning {
  border-color: #d8d2be;
  border-left-color: var(--draft-border);
  background: var(--draft-bg);
}

.iteration {
  margin: 38px 0;
  padding: 24px 0 8px;
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.iteration-number {
  margin-bottom: 6px !important;
  color: var(--muted) !important;
  font-size: 11px !important;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-ui);
}

.iteration h3 {
  margin-top: 0;
}

table {
  width: 100%;
  margin: 24px 0 34px;
  overflow: hidden;
  border: 1px solid #dfe4ed;
  border-collapse: collapse;
  border-spacing: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  font-size: 13px;
  font-family: var(--font-ui);
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f0f0ec;
  color: #3c3c3a;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #f6f6f2;
}

.results-table {
  font-variant-numeric: tabular-nums;
}

.references li {
  color: #475467;
  font-size: 14px;
}

.end-note {
  margin-top: 48px;
}

.end-note p {
  margin: 0;
  font-size: 14px;
}

@media (min-width: 1000px) {
  .figure-placeholder.wide {
    width: min(920px, calc(100vw - 48px));
    margin-left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 620px) {
  .article-nav,
  .article-page {
    width: calc(100% - 32px);
  }

  .article-nav {
    top: 10px;
    margin-top: 10px;
  }

  .article-page {
    padding: 54px 0 88px;
  }

  .article-header h1 {
    font-size: 41px;
  }

  .article-deck {
    font-size: 17px;
  }

  .toc nav,
  .spec-grid {
    grid-template-columns: 1fr;
  }

  .article-content h2 {
    font-size: 27px;
  }

  .iteration {
    padding: 20px 18px 8px;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (max-width: 420px) {
  .article-header h1 {
    font-size: 36px;
  }
}
