@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=JetBrains+Mono:wght@400;700;800&display=swap');

:root {
  --base: #1e1e2e;
  --mantle: #181825;
  --text: #cdd6f4;
  --subtext: #bac2de;
  --overlay: #6c7086;
  --lavender: #b4befe;
  --mauve: #cba6f7;
  --peach: #fab387;
  --border: #2b2e3b;
  --surface: #1a1b26;
}

body {
  background: var(--base);
  color: var(--text);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  color: var(--overlay);
  font-size: .9rem;
  margin-top: .5rem;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  white-space: nowrap;
}

.meta-icon {
  width: 15px;
  height: 15px;
  opacity: .7;
  flex-shrink: 0;
}

.meta-sep {
  color: var(--overlay);
  opacity: .4;
  margin: 0 .15rem;
  user-select: none;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .75rem;
}

.tag {
  display: inline-block;
  background: rgba(203, 166, 247, .1);
  color: var(--mauve);
  font-size: .78rem;
  font-weight: 600;
  padding: .2rem .65rem;
  border-radius: 999px;
  border: 1px solid rgba(203, 166, 247, .15);
  letter-spacing: .2px;
  transition: background .15s, border-color .15s;
  text-decoration: none;
}

.tag:hover {
  background: rgba(203, 166, 247, .18);
  border-color: rgba(203, 166, 247, .3);
}

.row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .3rem;
}

.row-tags .tag {
  font-size: .7rem;
  padding: .12rem .5rem;
}

article {
  background: var(--mantle);
  border: 1px solid rgba(205, 214, 244, .08);
  border-radius: 16px;
  padding: 1.5rem;
  min-width: 0;
}

article>header {
  border-bottom: 1px solid rgba(205, 214, 244, .06);
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
}

.term-body article {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.term-body .blog-layout {
  max-width: none;
  margin: 0;
  padding: 0;
}

.term-body :where(main, .container, article) {
  padding: 0;
  margin: 0;
}

.term-body .toc-nav {
  top: 3.5rem;
}


:where(main, .container, article) {
  font: 400 16px/1.85 Inter, system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  max-width: 820px;
  margin-inline: auto;
  padding: 2rem 1.25rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

:where(main, .container, article) h1 {
  font: 800 clamp(1.9rem, 3.2vw, 2.4rem) 'JetBrains Mono', 'Fira Mono', monospace;
  color: var(--lavender);
  margin: 1.3rem 0 0.9rem;
  letter-spacing: -0.2px;
}

:where(main, .container, article) h2 {
  font: 800 clamp(1.25rem, 2.5vw, 1.5rem) 'JetBrains Mono', 'Fira Mono', monospace;
  color: var(--mauve);
  margin: 1.4rem 0 0.7rem;
}

:where(main, .container, article) h3 {
  font: 700 1.15rem 'JetBrains Mono', 'Fira Mono', monospace;
  color: var(--lavender);
  margin: 1rem 0 0.6rem;
}

:where(main, .container, article) p {
  margin: 0.95rem 0;
  color: var(--subtext);
}

:where(main, .container, article) a {
  color: var(--lavender);
  text-decoration: underline;
}

:where(main, .container, article) a:hover {
  text-decoration-thickness: 2px;
}

:where(main, .container, article) :not(pre)>code {
  background: #313244;
  color: var(--mauve);
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 1em;
  padding: 0.1em 0.25em;
  border-radius: 4px;
  overflow-wrap: anywhere;
  word-break: break-all;
}

:where(main, .container, article) pre {
  background: var(--mantle);
  color: #cdd6f4;
  padding: 0;
  border-radius: 0.3rem;
  border: 1px solid #313244;
  overflow-x: auto;
  margin: 1.5rem 0;
  width: 100%;
  max-width: 100%;
  position: relative;
  box-shadow: 0.1rem 0.1rem 0.2rem rgba(24, 24, 37, .5);
}

:where(main, .container, article) pre .code-tab-bar {
  display: flex;
  background: linear-gradient(to top, transparent 1.5px, transparent 1.5px),
    linear-gradient(#11111b, #11111b);
  background-repeat: no-repeat;
  padding-inline-start: 0;
}

:where(main, .container, article) pre .code-tab-bar .code-tab {
  position: relative;
  color: var(--mauve);
  background: #1e1e2e;
  background-clip: padding-box;
  padding: calc(0.25rem + 1.5px) 1rem;
  border: 1.5px solid transparent;
  border-radius: calc(0.3rem + 1.5px) calc(0.3rem + 1.5px) 0 0;
  border-bottom: none;
  overflow: hidden;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.65;
}

:where(main, .container, article) pre .code-tab-bar .code-tab::after {
  content: '';
  position: absolute;
  pointer-events: none;
  inset: 0;
  border-top: 1.5px solid var(--mauve);
}

:where(main, .container, article) pre[data-filename] .code-tab-bar {
  display: none;
}

:where(main, .container, article) pre[data-filename]::before {
  content: attr(data-filename);
  display: block;
  background: #11111b;
  color: var(--mauve);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.82rem;
  padding: calc(0.25rem + 1.5px) 1rem;
  border-bottom: 1.5px solid transparent;
}

:where(main, .container, article) pre code {
  all: unset;
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 1rem 0;
  color: #cdd6f4;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.65;
  overflow-x: auto;
  background: transparent !important;
}

:where(main, .container, article) pre::-webkit-scrollbar,
:where(main, .container, article) pre::-webkit-scrollbar-track {
  background-color: inherit;
  border-radius: 0.3rem;
}

:where(main, .container, article) pre::-webkit-scrollbar-thumb {
  background-color: rgba(88, 91, 112, .5);
  border: 4px solid transparent;
  background-clip: content-box;
  border-radius: 10px;
}

.code-copy-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0.2rem;
  z-index: 2;
  cursor: pointer;
  transition: opacity 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 2rem;
  height: 2rem;
  background: var(--mantle);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

pre:hover .code-copy-btn {
  opacity: 0.75;
}

.code-copy-btn:hover {
  opacity: 1 !important;
}

.code-copy-btn.copied {
  opacity: 1 !important;
}

.code-copy-btn svg {
  width: 14px;
  height: 14px;
  stroke: #cdd6f4;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.code-copy-btn.copied svg {
  stroke: #a6e3a1;
}

pre:has(.code-tab-bar) .code-copy-btn {
  top: calc(1.65 * 0.82rem + 0.5rem + 1.5px + 0.4rem);
}

.hljs-ln {
  border-collapse: collapse;
  width: 100%;
  font-size: inherit;
}

.hljs-ln td {
  padding: 0;
  border: none;
}

.hljs-ln-numbers {
  text-align: right;
  padding-right: 1em !important;
  padding-left: .75em !important;
  color: #7f849c;
  user-select: none;
  -webkit-user-select: none;
  vertical-align: top;
  width: 2.5em;
}

.hljs-ln-code {
  padding-left: 1em !important;
}

:where(main, .container, article) ul,
:where(main, .container, article) ol {
  padding-left: 1.25rem;
  margin: .7rem 0;
}

:where(main, .container, article) li {
  margin: .35rem 0;
}

:where(main, .container, article) img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: .9rem 0;
}

:where(main, .container, article) blockquote {
  border-left: 3px solid var(--lavender);
  background: var(--mantle);
  color: var(--subtext);
  padding: .65rem .9rem;
  border-radius: 6px;
  margin: 1rem 0;
}

:where(main, .container, article) table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.95rem 0;
  font-size: 0.98rem;
}

:where(main, .container, article) th,
:where(main, .container, article) td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.6rem;
  text-align: left;
}

:where(main, .container, article) th {
  background: var(--mantle);
  color: var(--text);
}

:where(main, .container, article) hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

:where(main, .container, article) .bloglogo {
  all: unset;
  display: block;
  font: 800 clamp(1.9rem, 3.2vw, 2.4rem) 'JetBrains Mono', 'Fira Mono', monospace;
  color: var(--lavender);
  margin: 1.3rem 0 0.9rem;
}

.container>header>main,
.container>main>header {
  display: contents;
}

.container .content {
  max-width: 820px;
}

@media (max-width: 900px) {
  :where(main, .container, article) {
    padding: 1.5rem 1rem;
  }

  :where(main, .container, article) pre {
    font-size: 0.82rem;
  }
}

@media (max-width: 768px) {
  :where(main, .container, article) {
    font-size: 15px;
    line-height: 1.7;
    padding: 1.25rem 1rem;
  }

  :where(main, .container, article) h1 {
    font-size: clamp(1.6rem, 5vw, 1.9rem);
    margin: 1rem 0 0.7rem;
  }

  :where(main, .container, article) h2 {
    font-size: clamp(1.15rem, 4vw, 1.35rem);
    margin: 1.1rem 0 0.6rem;
  }

  :where(main, .container, article) h3 {
    font-size: 1.05rem;
    margin: 0.85rem 0 0.5rem;
  }

  :where(main, .container, article) p {
    margin: 0.75rem 0;
  }

  :where(main, .container, article) :not(pre)>code {
    font-size: 1em;
    padding: 0.05em 0.2em;
  }

  /* TEXT AUTOSIZING KILL-SWITCH + BRUTE FORCE OVERRIDE */
  article pre,
  article pre code,
  article pre span,
  article pre table,
  article pre td,
  article pre tr,
  article pre tbody,
  article pre div,
  article .highlight pre,
  article .highlight code,
  .hljs,
  .hljs span,
  .hljs-ln,
  .hljs-ln td {
    font-size: 11px !important;
    -webkit-text-size-adjust: none !important;
    text-size-adjust: none !important;
  }

  :where(main, .container, article) pre {
    padding: 0;
    margin: 0.6rem 0;
    border-radius: 0.3rem;
    max-width: 100%;
  }

  :where(main, .container, article) pre code {
    line-height: 1.5;
    padding: 0.5rem;
  }

  /* File names and tabs */
  article pre[data-filename]::before,
  article .code-tab-bar .code-tab {
    font-size: 11px !important;
    padding: 0.2rem 0.5rem;
    -webkit-text-size-adjust: none !important;
    text-size-adjust: none !important;
  }

  :where(main, .container, article) ul,
  :where(main, .container, article) ol {
    margin: 0.6rem 0;
  }

  :where(main, .container, article) li {
    margin: 0.3rem 0;
  }

  :where(main, .container, article) blockquote {
    padding: 0.55rem 0.75rem;
    margin: 0.8rem 0;
  }

  :where(main, .container, article) hr {
    margin: 1.2rem 0;
  }

  article {
    border-radius: 12px;
    padding: 1rem;
  }

  article>header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }

  .post-meta {
    font-size: .82rem;
  }

  .tag {
    font-size: .72rem;
    padding: .15rem .5rem;
  }
}

/* ============================================================
   BLOG LAYOUT + TABLE OF CONTENTS
   ============================================================ */

.blog-layout {
  display: block;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

@media (min-width: 768px) {
  .blog-layout {
    padding: 0 1.25rem;
  }
}

.toc {
  display: none;
}

@media (min-width: 1100px) {
  .blog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 2.5rem;
    align-items: start;
  }

  .toc {
    display: block;
    min-width: 0;
  }
}

.toc-nav {
  position: sticky;
  top: 1rem;

  max-height: calc(100vh - 7rem);
  overflow-y: auto;

  padding: .85rem;

  background: rgba(24, 24, 37, .82);
  border: 1px solid rgba(205, 214, 244, .08);
  border-radius: 12px;

  scrollbar-width: thin;
  scrollbar-color: var(--overlay) transparent;

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.toc-nav::-webkit-scrollbar {
  width: 5px;
}

.toc-nav::-webkit-scrollbar-track {
  background: transparent;
}

.toc-nav::-webkit-scrollbar-thumb {
  background: var(--overlay);
  border-radius: 999px;
}

.toc-title {
  display: block;
  padding: .15rem .55rem .7rem;

  font:
    600 .72rem Inter,
    system-ui,
    sans-serif;

  color: var(--overlay);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-item {
  margin: 0;
  padding: 0;
}

.toc-h2 {
  padding-left: .45rem;
}

.toc-h3 {
  padding-left: .9rem;
}

.toc-link {
  display: block;
  padding: .42rem .65rem;

  color: var(--subtext);
  text-decoration: none;

  font-size: .84rem;
  line-height: 1.4;

  border-left: 2px solid transparent;
  border-radius: 6px;

  transition:
    background .15s ease,
    color .15s ease,
    border-color .15s ease;

  overflow-wrap: break-word;
}

.toc-link:hover {
  color: var(--lavender);
  background: rgba(180, 190, 254, .06);
}

.toc-link.active {
  color: var(--mauve);
  background: rgba(203, 166, 247, .10);
  border-left-color: var(--mauve);
  font-weight: 600;
}

.blog-layout article {
  min-width: 0;
  max-width: 820px;
}

@media (min-width: 1100px) and (max-width: 1250px) {
  .blog-layout {
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 1.75rem;
  }
}

/* ============================================================
   HTTP BENCH ARTICLE
   ============================================================ */

.blog-page {
  max-width: 1180px;
}

.blog-terminal {
  position: relative;
  width: min(1180px, 94vw);
  max-height: calc(100vh - 120px);
}

.blog-terminal > .term-body {
  overflow-y: auto;
  min-height: 0;
}

.blog-terminal .blog-layout {
  width: 100%;
}