@import url("./reset.css");
@import url("https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css");

@font-face {
  font-family: "Quiet Mono";
  src: url("https://fonts.gstatic.com/s/dmmono/v16/aFTT7PB1QTsUX8KYth-orYadYY35Zlk.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --text: #151515;
  --muted: #696969;
  --soft: #8b8b8b;
  --line: #e7e7e7;
  --line-strong: #d4d4d4;
  --surface: #fafafa;
  --surface-hover: #f5f5f5;
  --max: 980px;
  --wide: 1120px;
  --font: "Quiet Mono", "DM Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --font-fa: "Vazirmatn", Tahoma, Arial, sans-serif;
}

html {
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

::selection {
  background: hotpink;
  background: hotpink;
  color: #ffffff;
}

.container {
  width: min(calc(100% - 2rem), var(--max));
  margin-inline: auto;
}

.container-wide {
  width: min(calc(100% - 2rem), var(--wide));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 999;
  padding: 0.6rem 0.75rem;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--text);
}

.brand-mark {
  width: 0.65rem;
  height: 0.65rem;
  border: 1px solid var(--text);
  border-radius: 50%;
}

.nav-toggle {
  display: none;
  padding: 0.4rem 0;
  color: var(--muted);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-list a,
.social-links a,
.post-link,
.meta-link,
.back-link,
.text-link {
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms ease;
}

.nav-list a:hover,
.nav-list a[aria-current="page"],
.social-links a:hover,
.post-link:hover,
.meta-link:hover,
.back-link:hover,
.text-link:hover {
  color: var(--text);
}

main {
  min-height: calc(100vh - 144px);
}

[hidden] {
  display: none !important;
}

.home-main {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 74px);
  padding: 4rem 0;
}

.home-card {
  display: grid;
  justify-items: center;
  width: min(100%, 900px);
  text-align: center;
}


.home-name {
  font-size: clamp(2.2rem, 9vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: -0.07em;
  font-weight: 500;
  white-space: nowrap;
}

.home-description {
  max-width: 58ch;
  margin-top: 1.2rem;
  color: var(--muted);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 1rem;
  margin-top: 1.7rem;
  color: var(--muted);
}

.page {
  padding: 4rem 0 5rem;
}

.page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}

.page-title {
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 1;
  letter-spacing: -0.065em;
  font-weight: 400;
}

.page-title[data-blog-title] {
  white-space: nowrap;
}

.emoji-icon {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin-left: 0.12em;
  vertical-align: -0.08em;
}

.page-intro {
  max-width: 85ch;
  margin-top: 1rem;
  color: var(--muted);
}

.page-title[lang="fa"],
.page-intro[lang="fa"] {
  font-family: var(--font-fa);
  letter-spacing: 0;
}

.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 3.5rem;
  align-items: start;
}

.post-list {
  display: grid;
  gap: 0;
}

.post-card {
  display: grid;
  gap: 0.55rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}

.post-card:first-child {
  padding-top: 0.45rem;
}

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

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  color: var(--soft);
  font-size: 0.78rem;
}

.post-meta a,
.post-tags a {
  color: inherit;
}

.post-title {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.25;
  font-weight: 400;
  letter-spacing: -0.035em;
}

.post-title a {
  color: var(--text);
}

.post-excerpt {
  max-width: 66ch;
  color: var(--muted);
}

.post-link {
  justify-self: start;
  margin-top: 0.2rem;
  font-size: 0.86rem;
}

.post-card-rtl {
  direction: rtl;
  text-align: right;
  font-family: var(--font-fa);
  letter-spacing: 0;
}

.post-card-rtl .post-link {
  justify-self: end;
}

.post-card-rtl .post-title,
.post-card-rtl .post-excerpt {
  letter-spacing: 0;
  line-height: 1.8;
}

.post-card-rtl .post-meta,
.article-rtl .post-meta {
  direction: rtl;
  font-family: var(--font);
  letter-spacing: -0.01em;
}

.post-card-rtl .post-meta time,
.article-rtl .post-meta time {
  direction: ltr;
  unicode-bidi: isolate;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.6rem;
}

.pagination:empty {
  display: none;
}

.pagination a {
  color: var(--muted);
  font-size: 0.84rem;
}

.pagination a:hover,
.pagination a[aria-current="page"] {
  color: var(--text);
}

.pagination a[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.35;
}

.sidebar {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 1.4rem;
}

.side-box {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.side-box:first-child {
  border-top: 0;
  padding-top: 0;
}

.side-title {
  margin-bottom: 0.65rem;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.side-list {
  display: grid;
  gap: 0.42rem;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
}

.resume-grid {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

.resume-aside {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 1rem;
  color: var(--muted);
}

.resume-section {
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}

.resume-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.resume-section h2 {
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 400;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.resume-item {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 0;
}

.resume-item + .resume-item {
  border-top: 1px solid var(--line);
}

.resume-item h3 {
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: -0.03em;
}

.resume-item p,
.resume-item time {
  color: var(--muted);
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.article-wrap {
  width: min(calc(100% - 2rem), 760px);
  margin-inline: auto;
  padding: 3rem 0 5rem;
}

.article-header {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}

.article-title {
  margin-top: 1rem;
  font-size: clamp(1.5rem, 4vw, 2.15rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
  font-weight: 400;
}

.article-summary {
  max-width: 100ch;
  margin-top: 1rem;
  color: var(--muted);
}

.article-content {
  display: grid;
  gap: 1.2rem;
}

.article-content h2 {
  margin-top: 1rem;
  font-size: 1.35rem;
  line-height: 1.3;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.article-content p,
.article-content li {
  color: var(--muted);
  text-align: justify;
  text-justify: inter-word;
}

.article-content a {
  color: hotpink;
}

.article-content figure {
  margin: 0;
}

.article-content img {
  display: block;
  width: 100%;
  height: auto;
}

.article-content ul,
.article-content ol {
  display: grid;
  gap: 0.55rem;
  padding-left: 1.2rem;
  list-style: disc;
}

.article-content code {
  padding: 0.08rem 0.25rem;
  border: 1px solid var(--line);
  background: var(--surface);
}

.article-content pre {
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
}

.post-tags {
  margin-top: 1.2rem;
  color: var(--soft);
  font-size: 0.82rem;
}

.article-rtl .post-tags {
  direction: ltr;
  text-align: left;
  font-family: var(--font);
  letter-spacing: -0.01em;
}

.post-tags span {
  color: var(--muted);
}

.article-rtl {
  direction: rtl;
  text-align: right;
  font-family: var(--font-fa);
  letter-spacing: 0;
}

.article-rtl .article-title,
.article-rtl .article-content h2 {
  letter-spacing: 0;
}

.article-rtl .article-summary,
.article-rtl .article-content p,
.article-rtl .article-content li {
  line-height: 2;
}

.article-rtl .back-link {
  display: inline-flex;
  direction: ltr;
  font-family: var(--font);
  letter-spacing: -0.01em;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0;
  color: var(--soft);
  font-size: 0.82rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.not-found {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 146px);
  text-align: center;
}

.not-found-inner {
  max-width: 520px;
}

.not-found h1 {
  font-size: clamp(3rem, 18vw, 8rem);
  line-height: 0.9;
  font-weight: 400;
  letter-spacing: -0.08em;
}

.not-found p {
  margin-top: 1rem;
  color: var(--muted);
}

@media (max-width: 760px) {
  body {
    font-size: 0.92rem;
  }

  .site-header {
    padding: 0.9rem 0;
  }

  .header-inner {
    align-items: flex-start;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: relative;
  }

  .nav-list {
    position: absolute;
    top: 2.25rem;
    right: 0;
    z-index: 10;
    display: none;
    min-width: 180px;
    padding: 0.8rem;
    border: 1px solid var(--line);
    background: var(--bg);
  }

  .nav-list.is-open {
    display: grid;
    gap: 0.65rem;
  }

  .home-main {
    place-items: center;
    align-items: center;
  }

  .page {
    padding-top: 3rem;
  }

  .blog-layout,
  .resume-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sidebar,
  .resume-aside {
    position: static;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media print {
  .site-header,
  .site-footer,
  .button,
  .nav-toggle {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
    font-size: 11pt;
  }

  .page,
  .article-wrap {
    padding: 0;
  }

  .container,
  .container-wide {
    width: 100%;
  }

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

  a {
    text-decoration: none;
  }
}
