@import url("https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css");
@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&display=swap");

:root {
  --md-text-font: "Vazirmatn", sans-serif;
  --md-code-font: "Fira Code", monospace;
  --terminal-bg: #050505;
  --terminal-fg: #f4f4f4;
  --terminal-muted: #909090;
  --terminal-border: rgba(255,255,255,.15);
  --glass: rgba(127,127,127,.055);
  --glass-border: rgba(127,127,127,.20);
}

[data-md-color-scheme="default"] {
  --md-primary-fg-color: #050505;
  --md-primary-bg-color: #ffffff;
  --md-accent-fg-color: #000000;
  --md-default-bg-color: #ffffff;
  --md-default-fg-color: #111111;
  --md-code-bg-color: #f3f3f3;
  --md-code-fg-color: #111111;
  --md-typeset-a-color: #000000;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #050505;
  --md-primary-bg-color: #ffffff;
  --md-accent-fg-color: #ffffff;
  --md-default-bg-color: #080808;
  --md-default-fg-color: #ececec;
  --md-code-bg-color: #151515;
  --md-code-fg-color: #ffffff;
  --md-typeset-a-color: #ffffff;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(ellipse 75% 45% at 10% -10%, rgba(127,127,127,.055), transparent),
    radial-gradient(ellipse 60% 42% at 100% 0%, rgba(127,127,127,.045), transparent),
    var(--md-default-bg-color);
  background-attachment: fixed;
}

body,
.md-typeset {
  direction: rtl;
  text-align: right;
}

.md-typeset code,
.md-typeset pre,
.md-typeset pre > code {
  direction: ltr;
  text-align: left;
}

.md-header {
  background: rgba(5,5,5,.88) !important;
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid rgba(255,255,255,.11);
}

[data-md-color-scheme="default"] .md-header {
  background: rgba(255,255,255,.88) !important;
  border-bottom-color: rgba(0,0,0,.10);
}

.md-tabs {
  background: transparent !important;
  border-bottom: 1px solid rgba(127,127,127,.15);
}

.md-main__inner {
  max-width: 1450px;
}

.md-content__inner {
  max-width: 1100px;
  margin: auto;
  animation: fadeIn .45s cubic-bezier(.2,.8,.2,1);
}

.terminal {
  position: relative;
  overflow: hidden;
  margin: 0 0 2rem;
  border: 1px solid var(--terminal-border);
  border-radius: 18px;
  color: var(--terminal-fg);
  background:
    radial-gradient(circle at 82% 0%, rgba(255,255,255,.12), transparent 32%),
    linear-gradient(145deg, #111111, var(--terminal-bg));
  box-shadow: 0 24px 70px rgba(0,0,0,.18);
}

.terminal::before {
  content: "";
  position: absolute;
  inset: -40%;
  pointer-events: none;
  background: conic-gradient(
    from 0deg,
    transparent,
    rgba(255,255,255,.09),
    transparent 28%
  );
  animation: terminalSpin 18s linear infinite;
}

.terminal-top,
.terminal-body {
  position: relative;
  z-index: 1;
}

.terminal-top {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--terminal-border);
  background: rgba(255,255,255,.025);
}

.terminal-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #727272;
}

.terminal-title {
  margin-left: 7px;
  color: #a9a9a9;
  font: 500 11px/1 "Fira Code", monospace;
}

.terminal-body {
  padding: 18px 20px 22px;
  font: 500 13px/2 "Fira Code", monospace;
}

.terminal-line {
  opacity: 0;
  transform: translateX(-8px);
  animation: terminalLine .55s ease forwards;
}

.terminal-line:nth-child(1) { animation-delay: .18s; }
.terminal-line:nth-child(2) { animation-delay: .34s; }
.terminal-line:nth-child(3) { animation-delay: .50s; }
.terminal-line:nth-child(4) { animation-delay: .66s; }

.terminal-check {
  color: #ffffff;
}

.terminal-muted {
  color: #949494;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 1.8rem 1.9rem;
  margin: 0 0 2rem;
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 90% 10%, rgba(127,127,127,.12), transparent 34%),
    linear-gradient(145deg, var(--glass), rgba(127,127,127,.012));
  backdrop-filter: blur(12px) saturate(125%);
  -webkit-backdrop-filter: blur(12px) saturate(125%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -55%;
  pointer-events: none;
  background: conic-gradient(
    from 0deg,
    transparent,
    rgba(127,127,127,.10),
    transparent 28%
  );
  animation: heroSpin 22s linear infinite;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 0 0 .85rem;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.05;
  font-weight: 850;
  letter-spacing: -.035em;
  border: 0;
}

.hero p {
  max-width: 920px;
  margin: 0;
  font-size: 1.05rem;
  line-height: 2.05;
  opacity: .82;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: .8rem;
  margin-top: 1.4rem;
}

.stat {
  padding: .9rem 1rem;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(127,127,127,.035);
}

.stat b {
  display: block;
  margin-bottom: .2rem;
}

.grid.cards > ul > li {
  border: 1px solid var(--glass-border) !important;
  border-radius: 15px !important;
  background: rgba(127,127,127,.045) !important;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.grid.cards > ul > li:hover {
  transform: translateY(-4px);
  border-color: currentColor !important;
  box-shadow: 0 16px 46px rgba(0,0,0,.13);
}

.md-typeset h1 {
  font-weight: 850;
  letter-spacing: -.02em;
}

.md-typeset h2 {
  font-weight: 780;
  padding-bottom: .45rem;
  border-bottom: 1px solid rgba(127,127,127,.18);
}

.md-typeset .admonition {
  border-radius: 12px;
}

.md-typeset pre {
  border: 1px solid rgba(127,127,127,.18);
  border-radius: 12px;
  position: relative;
}

.md-typeset pre > code {
  border-left: 3px solid currentColor;
}

.md-typeset table:not([class]) {
  display: table;
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
}

.md-typeset .md-button {
  border-radius: 9px;
  font-weight: 700;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 0;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, #777, #111, #777);
  transition: width .08s linear;
}

[data-md-color-scheme="slate"] .reading-progress {
  background: linear-gradient(90deg, #aaa, #fff, #aaa);
}

.watermark {
  position: fixed;
  left: 14px;
  bottom: 13px;
  z-index: 40;
  padding: 5px 9px;
  border: 1px solid currentColor;
  border-radius: 7px;
  opacity: .24;
  pointer-events: none;
  font: 500 10px/1.2 "Fira Code", monospace;
  direction: ltr;
}

.back-to-top {
  position: fixed;
  left: 18px;
  bottom: 66px;
  z-index: 35;
  width: 44px;
  height: 44px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.back-to-top.visible {
  opacity: .9;
  transform: translateY(0);
  pointer-events: auto;
}

@keyframes heroSpin {
  to { transform: rotate(360deg); }
}

@keyframes terminalSpin {
  to { transform: rotate(360deg); }
}

@keyframes terminalLine {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero::before,
  .terminal::before,
  .terminal-line,
  .md-content__inner {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 760px) {
  .stats {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 1.25rem;
  }

  .watermark {
    display: none;
  }
}
