@font-face {
  font-family: "Supreme";
  src: url("../fonts/Supreme/Supreme-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 500;
  font-display: swap;
}

@font-face {
  font-family: "Supreme";
  src: url("../fonts/Supreme/Supreme-VariableItalic.ttf") format("truetype");
  font-style: italic;
  font-weight: 100 500;
  font-display: swap;
}

:root {
  --font-sans: "Supreme", sans-serif;
  --font-inter: "Supreme", sans-serif;
  --font-mono: "Geist Mono", monospace;
  --text-reg: 18px;
  --cv-paper: #fcfdea;
  --cv-ink: #302e2f;
  --cv-ink-strong: #242224;
  --cv-muted: #5a595b;
  --cv-rule: #cfd0c6;
  --cv-chip: #e8e7e2;
  --cv-link: #225980;
  --background: var(--cv-paper);
  --foreground: var(--cv-ink);
  --card: var(--cv-paper);
  --card-foreground: var(--cv-ink);
  --popover: var(--cv-paper);
  --popover-foreground: var(--cv-ink);
  --primary: var(--cv-ink-strong);
  --primary-foreground: var(--cv-paper);
  --secondary: var(--cv-chip);
  --secondary-foreground: var(--cv-ink);
  --muted: var(--cv-chip);
  --muted-foreground: var(--cv-muted);
  --accent: var(--cv-chip);
  --accent-foreground: var(--cv-ink);
  --border: var(--cv-rule);
  --input: var(--cv-rule);
  --ring: var(--cv-ink);
  --sidebar: var(--cv-paper);
  --sidebar-foreground: var(--cv-ink);
  --sidebar-accent: var(--cv-chip);
  --sidebar-accent-foreground: var(--cv-ink-strong);
  --sidebar-border: var(--cv-rule);
  --surface: rgb(232 231 226 / 58%);
  --code: rgb(232 231 226 / 74%);
  --code-foreground: var(--cv-ink);
  --code-highlight: rgb(245 214 73 / 18%);
  --code-number: var(--cv-muted);
}

article {
  font-family: var(--font-sans);
  font-size: var(--text-reg);
  line-height: 26px;
  font-weight: 400;
  font-optical-sizing: auto;
  font-synthesis: none;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  font-kerning: auto;
  font-variant-ligatures: common-ligatures contextual;
  font-feature-settings: "liga" 1, "calt" 1, "kern" 1;
}

/* Apple displays usually benefit from lighter grayscale smoothing. */
@supports (-webkit-touch-callout: none) {
  article {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 410;
  }
}

/* Firefox on Linux/Windows tends to look crisper without extra smoothing overrides. */
@supports (-moz-appearance: none) {
  article {
    text-rendering: auto;
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: auto;
    font-weight: 400;
  }
}

article p {
  font-size: var(--text-reg);
  line-height: 1.84;
  letter-spacing: -0.011em;
  word-spacing: -0.015em;
  text-wrap: pretty;
}

article li {
  line-height: 1.78;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

article strong,
article b {
  font-weight: 500;
}

article #page-header h1,
article .typography h2,
article .typography h3,
article .typography h4 {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  text-wrap: pretty;
}

article #page-header h1 {
  font-size: 1.2rem;
  line-height: 1.95rem;
}

article .typography h2 {
  font-size: 1.125rem;
  line-height: 1.55rem;
}

article .typography h3 {
  font-size: 1rem;
  line-height: 1.45rem;
}

article .typography h4 {
  font-size: 0.875rem;
  line-height: 1.3rem;
}

article .arithmatex {
  max-width: 100%;
}

article mark {
  --mark-color: 255 232 62;
  --mark-bg-angle: 50deg;
  border-radius: 3px 5px;
  background:
    conic-gradient(at 0 100%, rgb(var(--mark-color) / 100%) 1%, #fff0 3%) no-repeat 0 0 / auto 120%,
    conic-gradient(from 180deg at 100% 0, #fff0, rgb(var(--mark-color) / 100%) 1%, #fff0 4%) no-repeat 100% 100% / auto 120%,
    linear-gradient(var(--mark-bg-angle), rgb(var(--mark-color) / 60%), rgb(var(--mark-color) / 20%) 75%, rgb(var(--mark-color) / 55%)) no-repeat center / auto;
  color: inherit;
  padding: 0.03em 0.18em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.dark article mark {
  --mark-color: 130 92 24;
  background: linear-gradient(
    var(--mark-bg-angle),
    rgb(var(--mark-color) / 70%),
    rgb(var(--mark-color) / 55%) 75%,
    rgb(var(--mark-color) / 68%)
  ) no-repeat center / auto;
}

article mark:nth-of-type(3n + 2) {
  --mark-color: 245 214 73;
  --mark-bg-angle: 42deg;
}

article mark:nth-of-type(3n + 3) {
  --mark-color: 234 193 63;
  --mark-bg-angle: 138deg;
}

article .typography {
  counter-reset: article-step;
}

article .typography > ol {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}

article .typography > ol > li {
  counter-increment: article-step;
  position: relative;
  padding-left: 2.25rem;
  line-height: 1.95;
}

article .typography > ol > li + li {
  margin-top: 0.55rem;
}

article .typography > ol > li::before {
  content: counter(article-step) ".";
  position: absolute;
  left: 0;
  min-width: 1.65rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}

article .admonition,
article details {
  --callout-color: #171717;
  --callout-border: rgb(163 163 163 / 36%);
  --callout-background: rgb(245 245 244 / 82%);
  --callout-icon: url("https://api.iconify.design/lucide/file-text.svg");
  border-color: var(--callout-border);
  background: var(--callout-background);
  overflow: hidden;
}

article .admonition > p.admonition-title,
article details > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--callout-color);
  padding: 0.72rem 0.9rem 0;
  line-height: 1.3;
  background: transparent;
  border-bottom: 0;
}

article .admonition > p.admonition-title::before,
article details > summary::before {
  content: "";
  display: block;
  width: 1.08rem;
  height: 1.08rem;
  flex: 0 0 1.08rem;
  opacity: 1;
  background-color: var(--callout-color);
  mask-image: var(--callout-icon);
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-image: var(--callout-icon);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

article .admonition.note,
article details.note {
  --callout-icon: url("https://api.iconify.design/lucide/notebook-tabs.svg");
}

article .admonition.abstract,
article details.abstract {
  --callout-border: rgb(214 174 44 / 42%);
  --callout-background: rgb(245 214 73 / 11%);
  --callout-color: rgb(138 104 20);
  --callout-icon: url("https://api.iconify.design/lucide/list-checks.svg");
}

article .admonition.info,
article details.info {
  --callout-icon: url("https://api.iconify.design/lucide/info.svg");
}

article .admonition.tip,
article details.tip {
  --callout-border: rgb(214 174 44 / 42%);
  --callout-background: rgb(245 214 73 / 11%);
  --callout-color: rgb(138 104 20);
  --callout-icon: url("https://api.iconify.design/lucide/lightbulb.svg");
}

article .admonition.warning,
article details.warning {
  --callout-border: rgb(214 174 44 / 42%);
  --callout-background: rgb(245 214 73 / 11%);
  --callout-color: rgb(138 104 20);
  --callout-icon: url("https://api.iconify.design/lucide/triangle-alert.svg");
}

article .admonition.danger,
article details.danger {
  --callout-color: #991b1b;
  --callout-border: rgb(220 38 38 / 42%);
  --callout-background: rgb(220 38 38 / 10%);
  --callout-icon: url("https://api.iconify.design/lucide/octagon-alert.svg");
}

article .admonition.success,
article details.success {
  --callout-icon: url("https://api.iconify.design/lucide/circle-check-big.svg");
}

article .admonition.question,
article details.question {
  --callout-icon: url("https://api.iconify.design/lucide/circle-help.svg");
}

article .admonition.example,
article details.example {
  --callout-icon: url("https://api.iconify.design/lucide/book-open-check.svg");
}

article .admonition.quote,
article details.quote {
  --callout-icon: url("https://api.iconify.design/lucide/quote.svg");
}

article .admonition.todo,
article details.todo {
  --callout-icon: url("https://api.iconify.design/lucide/circle-plus.svg");
}

/* Keep callout body content block-level so nested lists don't collapse inline. */
article .admonition > p:not(.admonition-title):first-child,
article .admonition > p:not(.admonition-title):nth-child(2) {
  display: block;
  margin: 0;
}

article .admonition > p.admonition-title {
  margin: 0;
  flex-wrap: nowrap;
}

article .admonition > :not(.admonition-title) {
  margin-top: 0.75rem;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

article details > summary {
  list-style: none;
}

article details > summary::-webkit-details-marker {
  display: none;
}

article .admonition > :last-child,
article details > :last-child {
  padding-bottom: 0.85rem;
}

article .admonition li {
  display: list-item;
}

article .arithmatex .katex-display {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

article .arithmatex .katex-display > .katex {
  min-width: max-content;
}

[data-sidebar="menu-button"] {
  font-size: 14px;
  height: auto !important;
  min-height: 2.25rem;
  align-items: flex-start;
  line-height: 1.35;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

[data-sidebar="menu-button"] > span:last-child,
[data-sidebar="menu-button"] {
  text-wrap: pretty;
}

[data-sidebar="content"],
[data-sidebar="group-content"],
[data-sidebar="group-label"],
[data-sidebar="menu-sub"] {
  font-size: var(--text-reg);
}

.mobile-nav-dialog {
  width: 100vw; max-width: none;
  height: 100dvh; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: transparent;
}

.mobile-nav-dialog::backdrop { background: rgb(0 0 0 / 0.18); }

.mobile-nav-sheet {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgb(255 255 255 / 0.92);
  color: var(--foreground);
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1.25rem, env(safe-area-inset-bottom));
  backdrop-filter: blur(18px);
}

.dark .mobile-nav-sheet { background: rgb(18 18 18 / 0.9); }

.mobile-nav-head {
  position: sticky; top: 0; z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0 0.85rem;
  font-size: var(--text-reg);
  font-weight: 650;
  background: inherit;
}

.mobile-nav-head button {
  width: 2.25rem; height: 2.25rem;
  border-radius: 999px;
  background: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
}

.mobile-nav-list, .mobile-nav-children { display: grid; gap: 0.35rem; }

.mobile-nav-link,
.mobile-nav-section > summary {
  font-size: var(--text-reg);
  display: block;
  min-height: 2.75rem;
  border-radius: 0.8rem;
  padding: 0.7rem 0.8rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.mobile-nav-link.is-active { background: var(--accent); font-weight: 650; }

.mobile-nav-section > summary {
  position: relative;
  cursor: pointer;
  font-weight: 650;
  padding-right: 2.25rem;
}

.mobile-nav-section > summary::marker { content: ""; }

.mobile-nav-section > summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.85rem;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  opacity: 0.55;
  rotate: -45deg;
  translate: 0 -50%;
  transition: rotate 160ms ease;
}

.mobile-nav-section[open] > summary::after { rotate: 45deg; }

.mobile-nav-children {
  margin: 0.1rem 0 0.45rem 0.65rem;
  padding-left: 0.65rem;
  border-left: 1px solid var(--border);
}

.mobile-nav-depth-0,
.mobile-nav-depth-1,
.mobile-nav-depth-2,
.mobile-nav-depth-3 {
  font-size: var(--text-reg);
}

@media (max-width: 767px) {
  article {
    font-size: var(--text-reg);
  }

  article .admonition {
    font-size: 0.95rem;
  }
   .katex-display,

  .MathJax_Display {

    overflow-x: auto;

    overflow-y: hidden;

    padding-bottom: 0.25rem;

  }

  .katex-display > .katex {

    display: inline-block;

    min-width: 100%;

  }
}

/* CV-inspired visual system from cv.kumarshantanu.com. */
.dark {
  --cv-paper: #242224;
  --cv-ink: #fcfdea;
  --cv-ink-strong: #fcfdea;
  --cv-muted: #d2d3cf;
  --cv-rule: rgb(207 208 198 / 42%);
  --cv-chip: #3f3d41;
  --cv-link: #8ec5ff;
  --background: var(--cv-paper);
  --foreground: var(--cv-ink);
  --card: #302e2f;
  --card-foreground: var(--cv-ink);
  --popover: #302e2f;
  --popover-foreground: var(--cv-ink);
  --primary: var(--cv-ink);
  --primary-foreground: var(--cv-paper);
  --secondary: var(--cv-chip);
  --secondary-foreground: var(--cv-ink);
  --muted: var(--cv-chip);
  --muted-foreground: var(--cv-muted);
  --accent: var(--cv-chip);
  --accent-foreground: var(--cv-ink);
  --border: var(--cv-rule);
  --input: var(--cv-rule);
  --ring: var(--cv-ink);
  --sidebar: var(--cv-paper);
  --sidebar-foreground: var(--cv-ink);
  --sidebar-accent: var(--cv-chip);
  --sidebar-accent-foreground: var(--cv-ink);
  --sidebar-border: var(--cv-rule);
  --surface: rgb(63 61 65 / 82%);
  --code: rgb(63 61 65 / 88%);
  --code-foreground: var(--cv-ink);
  --code-highlight: rgb(245 214 73 / 16%);
  --code-number: var(--cv-muted);
}

html,
body,
#inner-body {
  background-color: var(--cv-paper);
}

body {
  color: var(--cv-ink);
  background-image: radial-gradient(circle, rgb(58 56 55 / 18%) 0.7px, transparent 0.8px);
  background-size: 24px 24px;
}

#inner-body {
  background-color: transparent;
}

header {
  border-bottom: 2px dotted var(--cv-rule);
  background-color: rgb(252 253 234 / 86%);
  backdrop-filter: blur(8px);
}

.dark header {
  background-color: rgb(36 34 36 / 88%);
}

header a,
header button,
#toc,
[data-sidebar="content"],
.mobile-nav-sheet {
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

header a,
header button {
  color: var(--cv-ink);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

header a:hover,
header button:hover,
article a {
  color: var(--cv-link);
}

article {
  color: var(--cv-ink);
}

article p,
article li,
article #summary {
  color: var(--cv-muted);
  font-size: var(--text-reg);
  line-height: 1.56;
  letter-spacing: 0.006em;
  word-spacing: 0;
}

article #summary {
  line-height: 1.45;
}

article #page-header h1,
article .typography h2,
article .typography h3,
article .typography h4 {
  color: var(--cv-ink-strong);
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-wrap: pretty;
}

article #page-header h1 {
  margin-bottom: 0.4rem;
  border-bottom: 2px dotted var(--cv-rule);
  padding-bottom: 0.85rem;
  font-size: clamp(2.1rem, 5vw, 2.05rem);
  line-height: 1;
  letter-spacing: 0.05em;
}

article .typography h2 {
  border-bottom: 2px dotted var(--cv-rule);
  padding-bottom: 0.55rem;
  font-size: 1.0625rem;
  line-height: 1.6;
}

article .typography h3 {
  color: var(--cv-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

article .typography h4 {
  color: var(--cv-muted);
  font-size: 0.875rem;
  line-height: 1.35;
}

article a {
  text-decoration-color: rgb(34 89 128 / 46%);
}

article blockquote {
  border-left: 2px dotted var(--cv-rule);
  color: var(--cv-muted);
}

article mark {
  --mark-color: 245 214 73;
}

article .admonition,
article details {
  --callout-border: rgb(207 208 198 / 90%);
  --callout-background: rgb(232 231 226 / 58%);
  border-radius: 5px;
}

[data-sidebar="menu-button"] {
  color: var(--cv-ink);
  border-radius: 5px;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

[data-sidebar="group-label"] {
  color: var(--cv-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

[data-sidebar="menu-button"][data-active="true"] {
  background: var(--cv-chip);
  color: var(--cv-ink-strong);
}

#toc p,
#toc a {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#toc p {
  color: var(--cv-muted);
  background: var(--cv-paper);
  border-bottom: 2px dotted var(--cv-rule);
}

#toc a {
  color: var(--cv-muted);
}

#toc a:hover,
#toc a[data-active="true"] {
  color: var(--cv-ink-strong);
}

article table,
article pre,
article code {
  border-radius: 5px;
}

article table {
  color: var(--cv-muted);
  border: 2px dotted var(--cv-rule);
  background: rgb(252 253 234 / 82%);
}

.dark article table {
  background: rgb(36 34 36 / 82%);
}

article table tr {
  border-bottom: 2px dotted var(--cv-rule);
}

article table thead tr th {
  color: var(--cv-ink-strong);
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mobile-nav-sheet {
  background: rgb(252 253 234 / 0.94);
}

.dark .mobile-nav-sheet {
  background: rgb(36 34 36 / 0.94);
}
