:root {
  --text: #212529;
  --muted: #6c757d;
  --light: #f8f9fa;
  --border: #e9ecef;
  --accent: #d10fbd;
  --accent-dark: #a20d92;
  --code: #f6f8fa;
  --max-width: 1040px;
  --article-width: 820px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding-top: 64px;
  color: var(--text);
  background: #fff;
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.96);
}

.nav {
  max-width: var(--max-width);
  height: 64px;
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: #111;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0;
}

.brand:hover {
  color: #111;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 15px;
}

.nav-links a {
  color: rgba(0, 0, 0, 0.72);
}

.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.reading-progress {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  border: 0;
  appearance: none;
}

.reading-progress::-webkit-progress-bar {
  background: transparent;
}

.reading-progress::-webkit-progress-value {
  background: var(--accent);
}

.reading-progress::-moz-progress-bar {
  background: var(--accent);
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 42px 15px 82px;
}

.post {
  max-width: var(--article-width);
  margin: 0 auto;
}

h1,
h2,
h3,
h4 {
  color: #111;
  line-height: 1.25;
  letter-spacing: 0;
}

h1 {
  margin: 0 0 0.3em;
  font-family: inherit;
  font-size: 38px;
  font-weight: 300;
}

h2 {
  margin: 2.1em 0 0.75em;
  font-size: 27px;
  font-weight: 500;
}

h3 {
  margin: 1.85em 0 0.7em;
  font-size: 22px;
  font-weight: 500;
}

h4 {
  margin: 1.6em 0 0.55em;
  font-size: 18px;
  font-weight: 500;
}

p {
  margin: 0 0 1.05em;
}

ul,
ol {
  margin-top: 0;
  margin-bottom: 1.15em;
  padding-left: 1.35em;
}

li + li {
  margin-top: 0.2em;
}

.lede {
  max-width: var(--article-width);
  color: #343a40;
  font-size: 19px;
  font-weight: 300;
  line-height: 1.6;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 34px 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 28px auto;
  border-radius: 4px;
}

figure {
  margin: 30px 0;
}

figcaption {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

blockquote {
  margin: 1.4em 0;
  padding: 0.2em 0 0.2em 1.1em;
  color: #555;
  border-left: 4px solid var(--border);
}

code {
  padding: 0.12em 0.28em;
  background: var(--code);
  border-radius: 3px;
  color: #d63384;
  font-size: 0.92em;
}

pre {
  overflow: auto;
  margin: 1.4em 0;
  padding: 16px;
  background: var(--code);
  border: 1px solid var(--border);
  border-radius: 4px;
}

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

table {
  width: 100%;
  margin: 1.4em 0;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  padding: 0.65em 0.75em;
  border-top: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

thead th {
  border-bottom: 2px solid #dee2e6;
  color: #111;
  font-weight: 500;
}

tbody tr:nth-child(odd) {
  background: #fbfbfb;
}

.post-header {
  margin: 0 auto 46px;
  padding: 38px 0 56px;
  border-bottom: 1px solid var(--border);
}

.post-header h1 {
  margin-bottom: 0.25em;
  font-size: 36px;
  font-weight: 300;
}

.post-date,
.post-meta,
.post-category {
  color: var(--muted);
  font-size: 16px;
  margin: 10px 0 0;
}

.post-meta span {
  padding: 0 8px;
}

.post-category {
  margin-top: 4px;
}

.subtitle {
  color: #555;
  font-size: 20px;
  font-weight: 300;
  line-height: 1.45;
  margin-bottom: 0;
}

.post-content {
  font-size: 17px;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 32px;
}

.social-links a {
  display: inline-flex;
  width: 31px;
  height: 31px;
  color: #111;
  align-items: center;
  justify-content: center;
}

.social-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.social-links svg {
  width: 31px;
  height: 31px;
  fill: currentColor;
}

.nav .social-links {
  margin: 0;
  gap: 10px;
}

.nav .social-links a {
  width: 26px;
  height: 26px;
}

.nav .social-links svg {
  width: 26px;
  height: 26px;
}

.home-posts {
  max-width: 720px;
  margin-top: 22px;
}

.home-post {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 16px;
}

.home-post .post-date {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  margin: 0;
  white-space: nowrap;
}

.home-post a {
  color: var(--accent);
  font-size: 18px;
  white-space: nowrap;
}

.home-post a:hover {
  color: var(--accent-dark);
  text-decoration: none;
}

.blog-index {
  max-width: 960px;
  margin: 0 auto;
}

.blog-preview {
  margin: 0 0 44px;
  padding: 0 0 58px;
  border-bottom: 1px solid var(--border);
}

.blog-preview:last-child {
  margin-bottom: 0;
}

.blog-preview h1 {
  margin: 0 0 8px;
  font-size: 34px;
  font-weight: 300;
  line-height: 1.28;
}

.blog-preview h1 a {
  color: #111;
}

.blog-preview h1 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.blog-description {
  color: #111;
  font-size: 20px;
  font-weight: 300;
  line-height: 1.45;
  margin: 0 0 20px;
}

.blog-preview .post-meta,
.blog-preview .post-category {
  color: #8a8f98;
  font-size: 17px;
  margin: 8px 0 0;
}

.references {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  column-gap: 44px;
  margin: 54px calc((var(--article-width) - var(--max-width)) / 2) 0;
  padding: 28px 0 10px;
  color: #7a7f87;
  border-top: 1px solid var(--border);
}

.references h2 {
  margin: 0;
  color: #70757d;
  font-size: 18px;
  font-weight: 500;
}

.references ol {
  margin: 0;
  padding-left: 1.25em;
}

.references li {
  padding-left: 0.25em;
  margin-bottom: 18px;
}

.references strong {
  color: #6a6f77;
  font-weight: 500;
}

.flow-viewer {
  width: min(720px, calc(100vw - 30px));
  margin: 28px 0 28px 50%;
  transform: translateX(-50%);
}

.flow-viewer iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 720 / 580;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.flow-viewer figcaption {
  margin-top: 10px;
}

.footnote {
  margin: 24px 0 0;
  padding-top: 16px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 14px;
}

sup a[role="doc-noteref"] {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.results-table-wrap {
  overflow-x: auto;
  margin: 26px 0 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.results-table {
  min-width: 780px;
  margin: 0;
  font-size: 14px;
}

.results-table caption {
  padding: 14px 18px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  text-align: left;
}

.results-table th,
.results-table td {
  white-space: nowrap;
}

.result-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  color: #4c5562;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  vertical-align: 1px;
}

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 15px 22px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 14px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 640px) {
  body {
    padding-top: 84px;
  }

  .nav {
    height: 84px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }

  .nav-links {
    gap: 16px;
  }

  .page {
    padding-top: 32px;
  }

  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 24px;
  }

  .subtitle,
  .lede {
    font-size: 18px;
  }

  .references {
    display: block;
    margin-right: 0;
    margin-left: 0;
  }

  .references h2 {
    margin-bottom: 16px;
  }

  .home-post {
    flex-wrap: wrap;
    gap: 4px 10px;
  }

  .home-post a {
    white-space: normal;
  }

  .home-post .post-date {
    display: block;
    margin-bottom: 2px;
  }

  .blog-preview {
    padding-bottom: 42px;
  }

  .blog-preview h1 {
    font-size: 30px;
  }
}
