@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@500;600;700;800&family=JetBrains+Mono:ital,wght@0,400;0,600;1,400&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,500;0,8..60,650;1,8..60,400;1,8..60,500&display=swap');

:root {
  --md-text-font: "Source Serif 4", Georgia, serif;
  --md-code-font: "JetBrains Mono", monospace;
  --heading-font: "DM Sans", system-ui, sans-serif;

  --paper: #f7f3ea;
  --paper-soft: #fffaf1;
  --paper-quiet: #ede6d8;
  --ink: #191815;
  --ink-soft: #3d3931;
  --muted: #71695f;
  --line: rgba(55, 48, 39, 0.14);
  --teal: #146f73;
  --teal-soft: #e1f0ed;
  --amber: #b96d23;
  --amber-soft: #f5dfbd;
  --blue: #245c9a;
  --code-bg: #171b1f;
  --code-fg: #ece8df;

  --md-primary-fg-color: var(--ink);
  --md-primary-fg-color--light: #34302a;
  --md-primary-fg-color--dark: #0e0d0b;
  --md-accent-fg-color: var(--teal);
  --md-default-bg-color: var(--paper);
  --md-default-fg-color: var(--ink);
  --md-default-fg-color--light: var(--muted);
  --md-code-bg-color: #f0e8dc;
  --md-code-fg-color: #172126;

  --reading-bg: var(--paper);
  --reading-surface: var(--paper-soft);
  --reading-border: var(--line);
  --text-muted: var(--muted);
}

html {
  background: var(--paper);
}

body {
  background:
    linear-gradient(90deg, rgba(20, 111, 115, 0.055) 0 1px, transparent 1px 100%) 0 0 / 4.5rem 4.5rem,
    radial-gradient(circle at 14% 8%, rgba(185, 109, 35, 0.1), transparent 22rem),
    linear-gradient(180deg, var(--paper-soft), var(--paper) 22rem);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(25, 24, 21, 0.018) 1px, transparent 1px);
  background-size: 100% 3px;
  mix-blend-mode: multiply;
  z-index: -1;
}

.md-header {
  background: rgba(247, 243, 234, 0.92);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  color: var(--ink);
  backdrop-filter: blur(16px);
}

.md-header__title,
.md-header__topic,
.md-nav__title,
.md-tabs__link,
.md-search__input {
  font-family: var(--heading-font);
}

.md-header__button,
.md-header__topic,
.md-header__title {
  color: var(--ink);
}

.md-search__form {
  background: rgba(25, 24, 21, 0.06);
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: none;
}

.md-search__form:hover,
.md-search__form:focus-within {
  background: var(--paper-soft);
  border-color: rgba(20, 111, 115, 0.28);
}

.md-search__input::placeholder {
  color: rgba(25, 24, 21, 0.52);
}

.md-main {
  background: transparent;
}

.md-main__inner {
  margin-top: 1.8rem;
}

.md-content {
  color: var(--ink);
}

.md-content__inner {
  max-width: 48rem;
  margin: 0 auto;
  padding-bottom: 4rem;
}

.md-content__inner::before {
  display: none;
}

.md-typeset {
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.72;
  letter-spacing: 0;
}

.md-typeset p,
.md-typeset li {
  max-width: 42rem;
}

.md-typeset p {
  margin: 1rem 0;
}

.md-typeset > p:first-of-type {
  color: #403a31;
  font-size: 1.18rem;
  line-height: 1.75;
}

.md-typeset > p:first-of-type em {
  color: #2f2a24;
  font-style: italic;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: var(--ink);
  font-family: var(--heading-font);
  font-weight: 800;
  letter-spacing: 0;
}

.md-typeset h1 {
  position: relative;
  max-width: 46rem;
  margin: 1.4rem 0 2.35rem;
  padding: 0 0 1.2rem;
  border-bottom: 0;
  font-size: clamp(2.05rem, 3.35vw, 3.45rem);
  line-height: 1.08;
}

.md-typeset h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(18rem, 55%);
  height: 4px;
  background: linear-gradient(90deg, var(--amber), var(--teal));
  border-radius: 999px;
}

.md-typeset h2 {
  margin-top: 3.2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 1.7rem;
  line-height: 1.22;
}

.md-typeset h3 {
  margin-top: 2.2rem;
  color: #243b3d;
  font-size: 1.22rem;
}

.md-typeset hr {
  margin: 2.4rem 0;
  border-bottom-color: var(--line);
}

.md-typeset a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: rgba(36, 92, 154, 0.28);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  transition: color 0.18s ease, text-decoration-color 0.18s ease, background 0.18s ease;
}

.md-typeset a:hover {
  color: var(--teal);
  text-decoration-color: currentColor;
}

.md-typeset strong {
  color: var(--ink);
  font-weight: 650;
}

.md-typeset blockquote {
  margin: 1.7rem 0;
  padding: 1rem 1.35rem;
  border-left: 4px solid var(--amber);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 250, 241, 0.78);
  color: #514a40;
  font-style: italic;
}

.md-typeset blockquote p {
  margin: 0.4rem 0;
}

.md-typeset img {
  display: block;
  max-width: min(100%, 64rem);
  margin: 1.5rem auto 0.75rem;
  border: 1px solid rgba(25, 24, 21, 0.13);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(36, 30, 22, 0.14);
}

.md-typeset figcaption,
.md-typeset p:has(> em:only-child) {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.md-typeset code:not([class]) {
  padding: 0.12em 0.36em;
  border: 1px solid rgba(20, 111, 115, 0.16);
  border-radius: 4px;
  background: rgba(225, 240, 237, 0.82);
  color: #173d40;
  font-size: 0.86em;
}

.md-typeset .highlight code:not([class]),
.md-typeset pre code:not([class]) {
  padding: 0;
  border: 0;
  background: transparent;
  color: #f0eadf;
}

.md-typeset pre,
.highlight pre,
pre code {
  border: 1px solid rgba(23, 27, 31, 0.88);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--code-bg) !important;
  color: var(--code-fg);
  box-shadow: 0 18px 38px rgba(23, 27, 31, 0.22);
}

.highlight code,
.highlight pre code {
  color: #f0eadf;
}

.highlight .na,
.highlight .nt,
.highlight .nl,
.highlight .nx,
.highlight .n {
  color: #8bd8d0;
}

.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sb {
  color: #f2c383;
}

.highlight .k,
.highlight .kc,
.highlight .kd,
.highlight .kn,
.highlight .o {
  color: #e58b69;
}

.highlight .m,
.highlight .mi,
.highlight .mf,
.highlight .kc {
  color: #d9ce7a;
}

.highlight .p,
.highlight .w {
  color: rgba(240, 234, 223, 0.74);
}

.highlight .c,
.highlight .c1,
.highlight .cm {
  color: rgba(240, 234, 223, 0.54);
  font-style: italic;
}

.md-clipboard {
  color: rgba(240, 234, 223, 0.72);
}

.md-clipboard:hover {
  color: #f2c383;
}

.highlight pre,
pre code {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.highlight pre:hover,
pre code:hover {
  border-left-color: var(--amber);
  box-shadow: 0 22px 48px rgba(23, 27, 31, 0.26);
}

.md-typeset .highlighttable,
.md-typeset .highlight,
.md-typeset pre {
  max-width: 100%;
}

.md-typeset table:not([class]) {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.72);
  box-shadow: 0 12px 28px rgba(36, 30, 22, 0.08);
}

.md-typeset table:not([class]) th {
  background: #e7efe8;
  color: #193f3e;
  font-family: var(--heading-font);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.md-typeset table:not([class]) td,
.md-typeset table:not([class]) th {
  border-color: var(--line);
  padding: 0.78rem 0.95rem;
}

.md-typeset table:not([class]) tr:hover td {
  background: rgba(20, 111, 115, 0.05);
}

.md-sidebar {
  color: var(--muted);
}

.md-sidebar--primary .md-sidebar__scrollwrap {
  margin-right: 0.8rem;
  padding: 0.45rem 0.35rem 0.8rem 0.65rem;
  border-left: 1px solid rgba(55, 48, 39, 0.08);
  background: transparent;
}

.md-sidebar__scrollwrap {
  scrollbar-color: rgba(25, 24, 21, 0.24) transparent;
}

.md-nav__title,
.md-nav__item .md-nav__link--active {
  color: var(--ink);
}

.md-nav__link {
  color: var(--muted);
  font-family: var(--heading-font);
  line-height: 1.34;
}

.md-sidebar--primary .md-nav__title {
  margin-bottom: 0.65rem;
  color: var(--ink);
  font-family: var(--heading-font);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.md-sidebar--primary .md-nav > .md-nav__list > .md-nav__item {
  margin: 0;
}

.md-sidebar--primary .md-nav > .md-nav__list > .md-nav__item > .md-nav__link,
.md-sidebar--primary .md-nav > .md-nav__list > .md-nav__item > .md-nav__container {
  margin-top: 0.22rem;
}

.md-sidebar--primary .md-nav > .md-nav__list > .md-nav__item--section > .md-nav__link,
.md-sidebar--primary .md-nav > .md-nav__list > .md-nav__item--section > .md-nav__container > .md-nav__link:first-child {
  display: block;
  margin-top: 1.1rem;
  padding: 0 0 0.18rem;
  border: 0;
  border-bottom: 1px solid rgba(55, 48, 39, 0.12);
  border-radius: 0;
  background: transparent;
  color: #31302b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-transform: none;
}

.md-sidebar--primary .md-nav > .md-nav__list > .md-nav__item--section > .md-nav__link::before,
.md-sidebar--primary .md-nav > .md-nav__list > .md-nav__item--section > .md-nav__container > .md-nav__link:first-child::before {
  content: none;
}

.md-sidebar--primary .md-nav > .md-nav__list > .md-nav__item:not(.md-nav__item--section) > .md-nav__link {
  padding: 0.16rem 0.34rem;
  border-radius: 5px;
  font-size: 13.5px;
  font-weight: 650;
}

.md-sidebar--primary .md-nav[data-md-level="1"] {
  margin: 0.34rem 0 0.86rem 0;
  padding-left: 0.58rem;
  border-left: 1px solid rgba(55, 48, 39, 0.12);
}

.md-sidebar--primary .md-nav[data-md-level="1"] .md-nav__link {
  margin: 0.04rem 0;
  padding: 0.16rem 0.42rem;
  border-radius: 5px;
  color: rgba(61, 57, 49, 0.74);
  font-size: 13.25px;
  font-weight: 500;
  line-height: 1.35;
}

.md-sidebar--primary .md-nav[data-md-level="1"] .md-nav__link:hover {
  background: rgba(20, 111, 115, 0.055);
}

.md-nav__link:hover {
  color: var(--teal);
}

.md-nav__item--active > .md-nav__link,
.md-nav__link--active {
  color: var(--amber);
  font-weight: 700;
}

.md-sidebar--primary .md-nav__link--active {
  box-shadow: inset 2px 0 0 var(--amber);
  background: rgba(185, 109, 35, 0.07);
  color: #7b4817;
  font-weight: 650;
}

.md-sidebar--primary .md-nav__item--active > .md-nav__link::before,
.md-sidebar--primary .md-nav__link--active::before {
  content: none;
}

.md-nav--secondary .md-nav__title {
  color: var(--ink);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.md-nav--secondary .md-nav__link {
  margin-left: -0.7rem;
  padding: 0.22rem 0 0.22rem 0.7rem;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: rgba(61, 57, 49, 0.76);
  font-size: 0.76rem;
  transition: color 0.18s ease, border-left-color 0.18s ease, background 0.18s ease;
}

.md-nav--secondary .md-nav__link:hover {
  border-left-color: rgba(20, 111, 115, 0.42);
  background: rgba(20, 111, 115, 0.055);
  color: var(--teal);
}

.md-nav--secondary .md-nav__link--active,
.md-nav--secondary .md-nav__item--active > .md-nav__link {
  border-left-color: var(--teal);
  background: rgba(20, 111, 115, 0.08);
  color: var(--teal);
  font-weight: 700;
}

.md-sidebar--secondary .md-sidebar__scrollwrap::-webkit-scrollbar {
  width: 4px;
}

.md-sidebar--secondary .md-sidebar__scrollwrap::-webkit-scrollbar-track {
  background: transparent;
}

.md-sidebar--secondary .md-sidebar__scrollwrap::-webkit-scrollbar-thumb {
  background: rgba(25, 24, 21, 0.24);
  border-radius: 2px;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  transition: width 0.1s ease-out;
}

.recent-updates {
  margin-top: 2rem;
}

.recent-updates h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.recent-updates h2::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(20, 111, 115, 0.1);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.post-card {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 100%;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.82);
  box-shadow: 0 10px 26px rgba(36, 30, 22, 0.08);
  text-decoration: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.post-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--teal), var(--amber));
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.2s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 111, 115, 0.32);
  box-shadow: 0 16px 32px rgba(36, 30, 22, 0.12);
}

.post-card:hover::before {
  transform: scaleY(1);
}

.post-card .post-category {
  margin-bottom: 0.55rem;
  color: var(--teal);
  font-family: var(--heading-font);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.post-card .post-title {
  margin-bottom: 0.45rem;
  color: var(--ink);
  font-family: var(--heading-font);
  font-size: 1.04rem;
  font-weight: 800;
  line-height: 1.32;
}

.post-card .post-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.post-card .post-meta {
  margin-top: 0.85rem;
  padding-top: 0.7rem;
  border-top: 1px dashed rgba(36, 30, 22, 0.14);
  color: rgba(36, 30, 22, 0.5);
  font-family: var(--md-code-font);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.post-card:hover .post-title {
  color: var(--teal);
}

.intro-terminal {
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px solid rgba(23, 27, 31, 0.88);
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-fg);
  font-family: var(--md-code-font);
  font-size: 0.9rem;
  box-shadow: 0 18px 38px rgba(23, 27, 31, 0.2);
}

.intro-terminal .prompt {
  color: #65c7bd;
}

.intro-terminal .command {
  color: #e4ae6f;
}

.intro-terminal .output {
  color: rgba(236, 232, 223, 0.86);
}

.md-footer {
  border-top: 1px solid var(--line);
  background: #171b1f;
}

@media screen and (max-width: 76.1875em) {
  .md-nav--primary .md-nav__title,
  .md-nav--primary .md-nav__source {
    background: var(--paper-soft);
    color: var(--ink);
  }

  .md-sidebar--primary {
    background: var(--paper);
  }
}

@media screen and (max-width: 44.9375em) {
  .md-main__inner {
    margin-top: 0.8rem;
  }

  .md-content__inner {
    padding: 0 0.85rem 3rem;
  }

  .md-typeset {
    font-size: 1rem;
    line-height: 1.68;
  }

  .md-typeset h1 {
    margin-top: 1rem;
    margin-bottom: 1.9rem;
    font-size: 2.25rem;
    line-height: 1.08;
  }

  .md-typeset > p:first-of-type {
    font-size: 1.08rem;
  }
}