.site-width {
  max-width: 68rem;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 30rem) {
  .site-width {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 60em) {
  .site-width {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media screen and (min-width: 30rem) {
  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media screen and (min-width: 60rem) {
  .posts-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
  }
}

.post-card {
  display: flex;
  height: 100%;
}

.post-card > * {
  flex: 1 1 auto;
}

.personal {
  fill: hsla(0,0%,100%,.9);
}

.personal:hover {
  fill: #E7040F;
}

@media screen and (min-width: 30em) {
  /* allow posts to be wider than Tachyons' default 34rem */
  .measure-wide-ns {
    max-width: 45rem;
    margin-left: auto;
    margin-right: auto;
  }
}

code {
  font-size: 0.85em;
}

:not(pre)>code {
  display: inline-block;
  padding: 0 .25em;
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 0.25em;
}

.highlight {
  margin: 0.5rem 0 1rem;
  border-radius: 0.5rem;
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
}

.code-block-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.5rem 1rem 0.5rem;
  color: #6c6c6c;
  background: #edf2f7;
  border: 1px solid #e1e4e8;
  border-bottom: none;
  border-radius: 0.35rem 0.35rem 0 0;
}

.code-block-meta button {
  border: 1px solid #d0d7de;
  background: #fff;
  color: #333;
  width: 24px;
  height: 24px;
  border-radius: 0.5rem;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
  padding: 0;
}

.code-block-meta button svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
}

.code-block-meta button:hover,
.code-block-meta button:focus {
  background: #edf2f7;
  outline: none;
}

.code-block-meta button.copied {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

.code-block-meta button.error {
  background: #b91c1c;
  color: #fff;
  border-color: #b91c1c;
}

.github-button {
  background: #0f172a;
  color: #fff !important;
  border: 1px solid #0f172a;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.github-button:hover,
.github-button:focus {
  background: #111;
  border-color: #111;
  color: #fff !important;
}

/* post table styling */
article :where(table):not(:where(.gist *)) {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;

  thead th {
    background: #f6f8fa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
  }

  th,
  td {
    border: 1px solid #e2e8f0;
    padding: 0.6rem 0.75rem;
  }

  tbody tr:nth-child(even) {
    background: #fbfcfe;
  }

  td:nth-child(1),
  td:nth-child(4),
  td:nth-child(5) {
    text-align: right;
  }

  @media (max-width: 40em) {
    & {
      display: block;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }

    th,
    td {
      white-space: nowrap;
    }
  }
}

.pagination .page-link {
  border: 1px solid #e2e8f0;
  border-radius: 0.25rem;
  margin-right: 0.3rem;
  color: #111;
  transition: background 0.15s ease, color 0.15s ease;
}

.pagination .page-item.active .page-link {
  background: #111;
  color: #fff;
}

.pagination .page-link:hover,
.pagination .page-link:focus {
  background: #111;
  color: #fff;
}

.social-link {
  color: inherit;
  transition: color 0.2s ease, transform 0.2s ease;
}

.social-link svg path,
.social-link svg {
  fill: currentColor;
  stroke: none;
}

.social-link:hover,
.social-link:focus {
  color: #1d4ed8;
  transform: translateY(-1px);
}


.highlight pre {
  margin: 0;
  padding: 1rem;
  border-radius: 0 0 0.4rem 0.4rem;
  border: none;
  border-top: 1px solid #e1e4e8;
  background: #f6f8fa !important;
  color: #24292e !important;
  overflow: auto;
}

.highlight pre code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85em;
  line-height: 1.5;
  display: block;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: rgb(17, 17, 17);
    color: #e4e4e4 !important;
  }
  .nested-links a {
    color: #77b2e3;
  }
  .black{
    color:#e4e4e4;
  }
  .black-80 {
    color: #e4e4e4;
  }
  .near-black{
      color:#e4e4e4;
  }
  .dark-gray{
      color:#e4e4e4;
  }
  .mid-gray {
      color:#e4e4e4;
  }
  .bg-light-gray {
    background-color: #272822;
  }
  :not(pre)>code {
    background: rgb(17, 17, 17);
    border-color: #2d2d2d;
    color: inherit;
  }
  a code {
    color: inherit;
  }
  .highlight {
    background: #0f1117;
    border-color: #2d2d2d;
  }
  .highlight pre {
    background: #0f1117 !important;
    color: #f8f8f2 !important;
    border-top: 1px solid #2d2d2d;
  }
  .code-block-meta {
    color: #9ca3af;
    background: #111827;
    border-color: #1f2937;
  }
  .code-block-meta button {
    border-color: #4b5563;
    background: #1f2937;
    color: #f8f8f2;
  }
  .code-block-meta button:hover,
  .code-block-meta button:focus {
    background: #374151;
  }
  .code-block-meta button.copied {
    background: #2563eb;
    border-color: #2563eb;
  }
  .github-button {
    background: #f3f4f6;
    color: #0f172a !important;
    border-color: #f3f4f6;
  }
  .github-button:hover,
  .github-button:focus {
    background: #e5e7eb;
    border-color: #e5e7eb;
    color: #0f172a !important;
  }
  article thead th {
    background: #1f2933;
    color: #f8f8f2;
  }
  article th,
  article td {
    border-color: #2e3541;
  }
  article tbody tr:nth-child(even) {
    background: #151a22;
  }
  .pagination .page-link {
    border-color: #374151;
    background: #111827;
    color: #f3f4f6;
  }
  .pagination .page-item.active .page-link {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
  }
  .pagination .page-link:hover,
  .pagination .page-link:focus {
    background: #1f2937;
    color: #f3f4f6;
  }
  .social-link {
    color: #f3f4f6;
  }
  .social-link:hover,
  .social-link:focus {
    color: #60a5fa;
  }
  .social-link svg *,
  .social-link svg path,
  .social-link svg use {
    fill: currentColor !important;
    stroke: none !important;
  }
  .toc-container {
    color: #dee3f0;
  }
  .toc-container .toc-heading {
    color: #e2e8f0;
  }
  .toc-container a {
    color: inherit;
  }
  .toc-container a:visited {
    color: inherit;
  }
  .toc-container a:hover,
  .toc-container a:focus {
    color: #96ccff;
  }
  .toc-container a.active {
    color: #77b2e3;
  }
}

.toc-container {
  position: sticky;
  top: 4rem;
  font-size: 0.85rem;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  color: #5d6577;
}

.toc-container .toc-heading {
  font-weight: 600;
  color: #596175;
  letter-spacing: 0.08em;
  margin: 1rem 0 1rem;
}

.toc-container nav ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.toc-container li ul {
  margin: 0 0 0 1rem;
  padding-left: 0;
  display: block;
}

.toc-container a {
  color: inherit;
  text-decoration: none;
  margin-bottom: 1rem;
  display: block;
  /* padding: 0.25rem 0; */
  transition: color 0.15s ease;
}

.toc-container a:visited {
  color: inherit;
}

.toc-container a:hover,
.toc-container a:focus {
  color: #96ccff;
}

.toc-container a.active {
  color: #357edd;
  font-weight: 500;
}

.mermaid {
  margin: 1.5rem 0;
}

sup .footnote-ref {
  text-decoration: none;
  color: #357edd;
  display: inline-flex;
  gap: 0.05em;
  align-items: center;
  justify-content: center;
  padding: 0.05em 0.25em;
  line-height: 1;
  border-radius: 0.35em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease, background 0.15s ease;
}

sup .footnote-ref::before {
  content: "[";
}

sup .footnote-ref::after {
  content: "]";
}

sup .footnote-ref:visited {
  color: #2b6cb0;
}

sup .footnote-ref:hover,
sup .footnote-ref:focus {
  text-decoration: underline;
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.12);
}

.footnote-ref-wrapper {
  position: relative;
  display: inline-block;
}

sup.footnote-ref-wrapper {
  display: inline;
}

.footnote-tooltip {
  position: absolute;
  bottom: calc(100% + 0.35rem);
  left: 50%;
  transform: translate(-50%, 0.35rem);
  width: max-content;
  max-width: min(26rem, 80vw);
  padding: 0.75rem 1rem;
  border-radius: 0.6rem;
  background: #ffffff;
  color: #111;
  font-size: 0.85rem;
  line-height: 1.35;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 30;
  white-space: normal;
  overflow-wrap: anywhere;
}

.footnote-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

.footnote-ref-wrapper:hover .footnote-tooltip,
.footnote-ref-wrapper:focus-within .footnote-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.footnotes {
  --footnote-highlight: rgba(59, 130, 246, 0.2);
}

.footnotes li {
  scroll-margin-top: 5rem;
  margin: 0.35rem 0;
}

.footnotes li p {
  border-radius: 0.35rem;
  padding: 0.3rem 0.6rem;
  margin: 0;
  transition: background 0.2s ease;
}

.footnotes li:target p {
  background: var(--footnote-highlight);
}

sup[id^="fnref"] {
  scroll-margin-top: 5rem;
}

sup[id^="fnref"]:target {
  background: rgba(59, 130, 246, 0.18);
  border-radius: 0.35rem;
}

@media (hover: none) {
  .footnote-tooltip {
    display: none;
  }
}

@media (prefers-color-scheme: dark) {
  sup .footnote-ref,
  sup .footnote-ref:visited {
    color: #77b2e3;
  }
  sup .footnote-ref:hover,
  sup .footnote-ref:focus {
    color: #96ccff;
  }
  .footnote-tooltip {
    background: #0f172a;
    color: #f8fafc;
    box-shadow: 0 15px 35px rgba(2, 6, 23, 0.55);
  }
  .footnote-tooltip::after {
    border-color: #0f172a transparent transparent transparent;
  }
  .footnotes {
    --footnote-highlight: rgba(147, 197, 253, 0.3);
  }
  sup[id^="fnref"]:target {
    background: rgba(147, 197, 253, 0.28);
  }
}

/* Chroma syntax highlighting (light) */
.chroma {
  background-color: transparent;
}
.chroma .err { color: #a61717; background-color: #e3d2d2 }
.chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
.chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; }
.chroma .hl { background-color: #ffffcc }
.chroma .lnt { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; color: #7f7f7f }
.chroma .ln { white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; color: #7f7f7f }
.chroma .line { display: flex; }
.chroma .k { color: #000; font-weight: bold }
.chroma .kc { color: #000; font-weight: bold }
.chroma .kd { color: #000; font-weight: bold }
.chroma .kn { color: #000; font-weight: bold }
.chroma .kp { color: #000; font-weight: bold }
.chroma .kr { color: #000; font-weight: bold }
.chroma .kt { color: #445588; font-weight: bold }
.chroma .na { color: #008080 }
.chroma .nb { color: #0086b3 }
.chroma .bp { color: #999 }
.chroma .nc { color: #445588; font-weight: bold }
.chroma .no { color: #008080 }
.chroma .nd { color: #3c5d5d; font-weight: bold }
.chroma .ni { color: #800080 }
.chroma .ne { color: #990000; font-weight: bold }
.chroma .nf { color: #990000; font-weight: bold }
.chroma .nl { color: #990000; font-weight: bold }
.chroma .nn { color: #555 }
.chroma .nt { color: #000080 }
.chroma .nv { color: #008080 }
.chroma .vc { color: #008080 }
.chroma .vg { color: #008080 }
.chroma .vi { color: #008080 }
.chroma .s { color: #dd1144 }
.chroma .sa, .chroma .sb, .chroma .sc, .chroma .dl,
.chroma .sd, .chroma .s2, .chroma .se, .chroma .sh,
.chroma .si, .chroma .sx, .chroma .s1 { color: #dd1144 }
.chroma .sr { color: #009926 }
.chroma .ss { color: #990073 }
.chroma .m, .chroma .mb, .chroma .mf, .chroma .mh,
.chroma .mi, .chroma .il, .chroma .mo { color: #009999 }
.chroma .o, .chroma .ow { color: #000; font-weight: bold }
.chroma .c, .chroma .ch, .chroma .cm, .chroma .c1 { color: #999988; font-style: italic }
.chroma .cs, .chroma .cp, .chroma .cpf { color: #999; font-weight: bold; font-style: italic }
.chroma .gd { color: #000; background-color: #ffdddd }
.chroma .gi { color: #000; background-color: #ddffdd }
.chroma .ge { color: #000; font-style: italic }
.chroma .gr { color: #aa0000 }
.chroma .gh { color: #999 }
.chroma .go { color: #888 }
.chroma .gp { color: #555 }
.chroma .gs { font-weight: bold }
.chroma .gu { color: #aaa }
.chroma .gt { color: #aa0000 }
.chroma .gl { text-decoration: underline }
.chroma .w { color: #bbb }

@media (prefers-color-scheme: dark) {
  .chroma {
    background-color: transparent;
    color: #f8f8f2;
  }
  .chroma .err { color: inherit; background: none; }
  .chroma .lnt, .chroma .ln { color: #7f7f7f; }
  .chroma .k, .chroma .kc, .chroma .kn, .chroma .kp,
  .chroma .kr, .chroma .nt, .chroma .o, .chroma .ow { color: #ff79c6; }
  .chroma .kd { color: #8be9fd; font-style: italic; }
  .chroma .kt { color: #8be9fd; }
  .chroma .na, .chroma .nc, .chroma .nf { color: #50fa7b; }
  .chroma .nb, .chroma .nl, .chroma .nv, .chroma .vc,
  .chroma .vg, .chroma .vi { color: #8be9fd; font-style: italic; }
  .chroma .s, .chroma .sa, .chroma .sb, .chroma .sc,
  .chroma .dl, .chroma .sd, .chroma .s2, .chroma .se,
  .chroma .sh, .chroma .si, .chroma .sx, .chroma .s1,
  .chroma .ss { color: #f1fa8c; }
  .chroma .sr { color: #f1fa8c; }
  .chroma .m, .chroma .mb, .chroma .mf, .chroma .mh,
  .chroma .mi, .chroma .il, .chroma .mo { color: #bd93f9; }
  .chroma .c, .chroma .ch, .chroma .cm, .chroma .c1,
  .chroma .cs { color: #6272a4; }
  .chroma .cp, .chroma .cpf { color: #ff79c6; }
  .chroma .gd {
    color: #ffb4ab;
    background-color: rgba(190, 24, 93, 0.25);
  }
  .chroma .gi {
    color: #c8facc;
    background-color: rgba(16, 185, 129, 0.25);
  }
  .chroma .go { color: #44475a; }
  .chroma .gh, .chroma .gu { color: #f8f8f2; }
}
