/* PiGPT /blog — server HTML, Vazirmatn, dark teal, tight density */
@font-face {
  font-family: Vazirmatn;
  src: url("/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("/fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("/fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("/fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #141414;
  --bg-2: #0f0f0f;
  --elev: #1c1c1c;
  --elev-2: #222;
  --ink: #e8e8e8;
  --muted: #8d8d8d;
  --faint: #5e5e5e;
  --brand: #2dd4bf;
  --brand-deep: #0f766e;
  --brand-ink: #042f2e;
  --brand-soft: rgba(45, 212, 191, 0.12);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.13);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
  --radius: 14px;
  --radius-sm: 10px;
  --font: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
  --max: 1080px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: #5eead4; }
:focus-visible { outline: 2px solid #5eead4; outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; inset-inline-start: 12px; top: -80px;
  background: var(--brand); color: var(--brand-ink);
  padding: 8px 12px; border-radius: 999px; z-index: 80; font-weight: 700; font-size: 13px;
}
.skip:focus { top: 10px; }

.shell {
  width: min(var(--max), calc(100% - 32px));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(20, 20, 20, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 12px;
  min-height: 54px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); margin-inline-end: auto;
}
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.brand strong { font-size: 15px; font-weight: 700; letter-spacing: 0.01em; }
.brand small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.2; }

.nav { display: none; gap: 4px; }
.nav a {
  color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--bg-hover, rgba(255,255,255,.05)); }

.header-actions { display: flex; align-items: center; gap: 6px; }
.nav-toggle {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
  cursor: pointer;
}
.nav-toggle span:not(.sr-only) {
  display: block; width: 14px; height: 1.5px; background: currentColor; border-radius: 2px;
}
.mobile-nav {
  display: none;
  gap: 2px; padding: 4px 16px 12px;
  border-top: 1px solid var(--line);
}
.mobile-nav.is-open,
.mobile-nav:not([hidden]) {
  display: grid;
}
.mobile-nav[hidden] {
  display: none !important;
}
.mobile-nav a {
  color: var(--ink); padding: 8px 4px; font-size: 14px; font-weight: 600;
}
.nav-overlay {
  display: none;
  position: fixed;
  inset: 54px 0 0 0;
  z-index: 35;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
}
.nav-overlay:not([hidden]) { display: block; }
.nav-overlay[hidden] { display: none !important; }
body.nav-locked { overflow: hidden; }

@media (min-width: 880px) {
  .nav { display: flex; }
  .nav-toggle, .mobile-nav, .nav-overlay { display: none !important; }
  body.nav-locked { overflow: unset; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px; padding: 7px 13px;
  font: inherit; font-size: 13px; font-weight: 700;
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: #5eead4; color: var(--brand-ink); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--line-2); }
.btn-lg { padding: 10px 16px; font-size: 14px; }

/* Hero */
.hero {
  padding: 28px 0 8px;
}
.hero-grid {
  display: grid; gap: 22px; align-items: center;
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 28px; }
}
.kicker {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand); font-size: 12px; font-weight: 700;
  margin: 0 0 10px;
}
.kicker svg { width: 14px; height: 14px; }
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 3.1vw, 2.05rem);
  line-height: 1.35; font-weight: 800; letter-spacing: -0.02em;
}
.lede {
  margin: 0 0 16px; color: var(--muted); font-size: 15px; max-width: 38rem; line-height: 1.75;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 9px;
}

.hero-visual {
  margin: 0; border-radius: calc(var(--radius) + 2px);
  overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow);
  background: var(--elev);
}
.hero-visual img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.hero-visual.hero-fade {
  border: 0; box-shadow: none; background: transparent;
  border-radius: 0; overflow: visible;
}
.hero-visual.hero-fade img {
  background: transparent;
  -webkit-mask-image: radial-gradient(ellipse 90% 84% at 50% 46%, #000 36%, rgba(0,0,0,.55) 62%, transparent 88%);
  mask-image: radial-gradient(ellipse 90% 84% at 50% 46%, #000 36%, rgba(0,0,0,.55) 62%, transparent 88%);
}

/* Sections */
.section { padding: 36px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { margin: 0 0 16px; display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2, .cat-hero h1 {
  margin: 0; font-size: clamp(1.15rem, 2.2vw, 1.42rem); font-weight: 800; line-height: 1.4;
}
.section-head p, .cat-hero p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; max-width: 40rem; }
.crumb {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 12px; font-weight: 700; color: var(--faint); margin: 0 0 10px;
}
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--brand); }

/* Features */
.feat-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 720px) {
  .feat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 980px) {
  .feat-grid { grid-template-columns: repeat(6, 1fr); }
}
.feat {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--elev); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 12px 11px;
  color: inherit; min-height: 100%;
}
.feat:hover { border-color: rgba(45, 212, 191, 0.35); color: inherit; }
.icon-orb {
  width: 32px; height: 32px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand);
  border: 1px solid rgba(45, 212, 191, 0.18);
}
.icon-orb svg { width: 16px; height: 16px; }
.feat h3 { margin: 0; font-size: 13px; font-weight: 800; }
.feat p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

/* Posts / cards */
.card-grid {
  display: grid; gap: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}
.card {
  background: var(--elev); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; color: inherit;
  display: flex; flex-direction: column; min-height: 100%;
}
.card:hover { border-color: rgba(45, 212, 191, 0.38); color: inherit; }
.card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.card-body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--muted);
}
.badge {
  background: var(--brand-soft); color: var(--brand);
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: 999px; padding: 2px 8px;
}
.card h3 { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.45; }
.card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; flex: 1; }
.soon { color: var(--faint); font-size: 11px; font-weight: 700; }

.empty {
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  padding: 22px 16px; text-align: center; background: rgba(255,255,255,.02);
}
.empty h3 { margin: 0 0 6px; font-size: 15px; }
.empty p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* Categories */
.cat-grid {
  display: grid; gap: 10px;
}
@media (min-width: 720px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}
.cat {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
  background: var(--elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
  color: inherit;
}
.cat:hover { border-color: rgba(45, 212, 191, 0.38); color: inherit; }
.cat h3 { margin: 0 0 4px; font-size: 15px; font-weight: 800; }
.cat p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.cat .icon-orb { width: 36px; height: 36px; border-radius: 11px; }

/* FAQ */
.faq { display: grid; gap: 8px; max-width: 760px; }
.faq details {
  background: var(--elev); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 0 14px;
}
.faq summary {
  cursor: pointer; font-weight: 800; font-size: 14px;
  padding: 12px 0; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] summary { color: var(--brand); }
.faq p { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; line-height: 1.7; }

/* CTA band */
.cta-band {
  background:
    radial-gradient(ellipse 50% 80% at 100% 0%, rgba(45, 212, 191, 0.12), transparent 55%),
    var(--bg-2);
}
.cta-band .section { padding: 28px 0; }
.final {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
}
.final h2 { margin: 0 0 4px; font-size: 1.2rem; font-weight: 800; }
.final p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* Footer */
.site-footer {
  padding: 18px 0 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px;
}
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 12px; }
.site-footer nav a { color: var(--muted); font-weight: 600; }
.site-footer nav a:hover { color: var(--ink); }

.cat-hero { padding: 22px 0 8px; }

@media (max-width: 639px) {
  .shell { width: min(var(--max), calc(100% - 24px)); }
  .section { padding: 28px 0; }
  .hero { padding: 20px 0 4px; }
}

.cat {
  padding: 0; overflow: hidden; gap: 0;
  grid-template-columns: 1fr;
}
.cat picture, .cat > img { width: 100%; }
.cat img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.cat-copy {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
  padding: 14px;
}
.card-title { margin: 0; font-size: 16px; font-weight: 800; }
.post { padding: 22px 0 8px; }
.post h1 {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 2.8vw, 1.9rem);
  line-height: 1.4; font-weight: 800;
}
.post-hero {
  margin: 14px 0 22px; border-radius: var(--radius); overflow: hidden;
  background: transparent;
}
.post-hero img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.prose { max-width: 720px; font-size: 15.5px; line-height: 1.85; }
.prose h2 { font-size: 1.12rem; margin: 1.55em 0 0.45em; font-weight: 800; }
.prose h3 { font-size: 1.02rem; margin: 1.25em 0 0.35em; font-weight: 800; }
.prose p { margin: 0 0 0.95em; }
.prose ul { margin: 0 0 1em; padding-inline-start: 1.15em; }
.prose li { margin: 0 0 0.4em; }
.prose a { font-weight: 650; }
.prose strong { font-weight: 800; }

/* PiGPT compact heroes + changelog cards */
.card-grid {
  display: grid; gap: 8px;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
.card-body { padding: 10px 11px 11px; gap: 5px; }
.post-hero {
  margin: 12px 0 16px; border-radius: var(--radius); overflow: hidden;
  background: transparent; max-width: 960px;
}
.post-hero img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.cat-feature {
  margin: 0 0 12px; border-radius: var(--radius); overflow: hidden;
  max-width: 960px; border: 1px solid var(--line);
}
.cat-feature img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.prose.changelog { max-width: 720px; }
.cl-list { display: grid; gap: 8px; margin: 0 0 1.1em; }
.cl {
  background: var(--elev); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px 8px;
}
.cl h2 {
  margin: 0 0 2px; font-size: 14px; font-weight: 800; line-height: 1.35;
}
.cl .cl-meta {
  margin: 0 0 8px; color: var(--muted); font-size: 11px; font-weight: 700;
}
.cl ul { margin: 0; padding-inline-start: 1.05em; }
.cl li { margin: 0 0 4px; font-size: 13.5px; line-height: 1.55; }
.cl li:last-child { margin-bottom: 0; }
.posts-slider__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.posts-slider__controls {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.posts-slider__nav {
  position: relative; z-index: 2;
  display: inline-flex; height: 2.35rem; width: 2.35rem;
  align-items: center; justify-content: center;
  border-radius: 0.9rem; border: 1px solid var(--line);
  background: rgba(255,255,255,.04); color: var(--ink);
  cursor: pointer; padding: 0;
  transition: border-color .2s ease, background-color .2s ease;
}
.posts-slider__nav svg { width: 16px; height: 16px; pointer-events: none; }
.posts-slider__nav:hover {
  border-color: rgba(45, 212, 191, 0.35);
  background: var(--brand-soft); color: #fff;
}
.posts-slider__viewport {
  overflow: hidden; width: 100%;
  padding-block: 0.2rem 0.35rem;
  direction: ltr;
  touch-action: pan-y; cursor: grab;
}
.posts-slider__viewport.is-dragging { cursor: grabbing; }
.posts-slider__track {
  display: flex; flex-wrap: nowrap; gap: 1rem; width: max-content;
  will-change: transform; direction: ltr;
  touch-action: pan-y; cursor: grab; user-select: none;
  transform: translate3d(0, 0, 0);
  transition: none;
  backface-visibility: hidden;
}
.posts-slider__track.is-instant,
.posts-slider__track.is-dragging { transition: none !important; }
.posts-slider__track.is-dragging { cursor: grabbing; }
.posts-slider__track.is-dragging .card { pointer-events: none; }
.posts-slider__slide .card,
.posts-slider__slide img { -webkit-user-drag: none; user-select: none; }
.posts-slider__slide {
  box-sizing: border-box;
  flex: 0 0 min(78vw, 20.5rem);
  width: min(78vw, 20.5rem);
  min-width: 0;
}
@media (min-width: 768px) {
  .posts-slider__slide {
    flex-basis: min(42vw, 21.5rem);
    width: min(42vw, 21.5rem);
  }
}
@media (min-width: 1280px) {
  .posts-slider__slide {
    flex-basis: 20.75rem;
    width: 20.75rem;
  }
}
.posts-slider__slide .card { height: 100%; min-height: 0; pointer-events: auto; }
.posts-slider__dots {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 10px; direction: ltr;
}
.posts-slider__dot {
  height: 0.4rem; width: 0.4rem; border-radius: 9999px;
  border: 0; padding: 0; cursor: pointer;
  background: rgba(148, 163, 184, 0.45);
  transition: width .25s ease, background-color .25s ease;
}
.posts-slider__dot.is-active {
  width: 1.35rem; background: var(--brand);
}
@media (prefers-reduced-motion: reduce) {
  .posts-slider__track { transition: none !important; }
  .posts-slider__dot { transition: none; }
}
.about { padding: 20px 0 10px; }
.about h2 { margin: 0 0 10px; }
#about .about-prose { max-width: none; width: 100%; }
.about-prose p { margin: 0 0 0.7em; font-size: 15px; line-height: 1.75; }
.about-prose p:last-child { margin-bottom: 0; }
#faq .faq { max-width: none; width: 100%; }
.post-shell { width: min(1240px, calc(100% - 32px)); }
.post-hero { max-width: none; }
.post-layout { display: grid; gap: 22px; margin-top: 2px; }
@media (min-width: 980px) {
  .post-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}
.post-main .prose { max-width: none; }
.post-aside {
  background: var(--elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px;
}
@media (min-width: 980px) {
  .post-aside { position: sticky; top: 64px; }
}
.aside-block + .aside-block {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.aside-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 0 8px; color: var(--brand);
  font-size: 11px; font-weight: 800;
}
.aside-kicker svg { width: 14px; height: 14px; }
.aside-cta {
  display: block; text-align: center;
  background: var(--brand); color: var(--brand-ink);
  border-radius: 10px; padding: 8px 10px;
  font-size: 12.5px; font-weight: 800; margin-bottom: 6px;
}
.aside-cta:hover { color: var(--brand-ink); background: #5eead4; }
.aside-cta-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line);
}
.aside-cta-ghost:hover { color: var(--ink); border-color: var(--line-2); }
.aside-list { display: grid; gap: 6px; }
.aside-link {
  display: block; background: rgba(255,255,255,.03);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 9px; color: inherit;
}
.aside-link:hover { border-color: rgba(45, 212, 191, 0.35); color: inherit; }
.aside-link-title { display: block; font-size: 12.5px; font-weight: 800; line-height: 1.45; }
.aside-link-meta { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); font-weight: 700; }
.aside-link-compact { font-size: 12.5px; font-weight: 700; padding: 7px 9px; }
.aside-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.aside-chip {
  font-size: 11px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: 999px; padding: 4px 9px;
}
.aside-chip:hover { color: #5eead4; }
.mobile-nav { display: none; }
.mobile-nav.is-open,
.mobile-nav:not([hidden]) { display: grid; }
.mobile-nav[hidden] { display: none !important; }
.nav-overlay {
  display: none; position: fixed; inset: 54px 0 0 0; z-index: 35;
  border: 0; padding: 0; margin: 0; cursor: pointer; background: rgba(0,0,0,.5);
}
.nav-overlay:not([hidden]) { display: block; }
.nav-overlay[hidden] { display: none !important; }
body.nav-locked { overflow: hidden; }
@media (min-width: 880px) {
  .nav-toggle, .mobile-nav, .nav-overlay { display: none !important; }
  body.nav-locked { overflow: unset; }
}
