/* Layout: a tidy software mirror — search-first header, category photo tiles,
   then a dense, scannable release list (version · size · licence · checksum state). RTL. */
@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Lalezar";
  src: url("fonts/lalezar-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC;
  font-display: swap;
}
@font-face {
  font-family: "Lalezar";
  src: url("fonts/lalezar-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122;
  font-display: swap;
}

:root {
  --bg: #f2f5f4;
  --surface: #ffffff;
  --ink: #13211f;
  --muted: #586764;
  --line: #d6dfdc;
  --accent: #0b7a62;
  --accent-hover: #086652;
  --accent-ink: #ffffff;
  --accent-soft: #dff0ea;
  --signal: #b8741a;
  --signal-soft: #f8ecd9;
  --shade: rgba(9, 24, 21, 0.62);

  --display: "Lalezar", "Vazirmatn", Tahoma, sans-serif;
  --body: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.0625rem;
  --step-2: 1.375rem;
  --step-3: 2rem;
  --step-4: clamp(2.25rem, 1.6rem + 2.8vw, 3.4rem);

  --radius: 10px;
  --max: 1160px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1615; --surface: #15201e; --ink: #e4ecea; --muted: #97a8a4; --line: #24322f;
    --accent: #2fb394; --accent-hover: #3cc6a5; --accent-ink: #06231c; --accent-soft: #163a31;
    --signal: #e3a54d; --signal-soft: #3a2a12; --shade: rgba(4, 10, 9, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1615; --surface: #15201e; --ink: #e4ecea; --muted: #97a8a4; --line: #24322f;
  --accent: #2fb394; --accent-hover: #3cc6a5; --accent-ink: #06231c; --accent-soft: #163a31;
  --signal: #e3a54d; --signal-soft: #3a2a12; --shade: rgba(4, 10, 9, 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.85;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.35; margin: 0; text-wrap: balance; }
p { margin: 0; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.num { font-variant-numeric: tabular-nums; }

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- header ---------- */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 24px; padding-block: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand b { font-family: var(--display); font-weight: 400; font-size: 1.9rem; line-height: 1; color: var(--accent); }
.brand span { font-size: var(--step--1); color: var(--muted); }
.nav { display: flex; gap: 20px; font-size: var(--step-0); }
.nav a { color: var(--ink); }
.search { margin-inline-start: auto; flex: 1 1 260px; max-width: 360px; position: relative; }
.search input {
  width: 100%; font: inherit; font-size: var(--step-0);
  padding: 9px 40px 9px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.search svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; stroke: var(--muted); fill: none; stroke-width: 2; }

/* ---------- hero ---------- */
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 40px; align-items: center; padding-block: 48px 40px;
}
.hero h1 { font-family: var(--display); font-weight: 400; font-size: var(--step-4); line-height: 1.25; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { margin-top: 14px; font-size: var(--step-1); color: var(--muted); max-width: 34em; }
.facts { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 10px; }
.facts li { display: flex; gap: 10px; align-items: flex-start; }
.facts svg { flex: none; width: 20px; height: 20px; margin-top: 4px; stroke: var(--accent); fill: none; stroke-width: 2.2; }
.stamp { margin-top: 22px; font-size: var(--step--1); color: var(--muted); }
.hero figure { margin: 0; position: relative; }
.hero figure img { border-radius: 14px; aspect-ratio: 14 / 10; object-fit: cover; width: 100%; }
.hero figcaption {
  position: absolute; inset-inline-start: 16px; bottom: 16px;
  background: var(--surface); color: var(--ink); border-radius: 8px;
  padding: 8px 14px; font-size: var(--step--1); box-shadow: 0 6px 18px rgba(0,0,0,.14);
  display: flex; gap: 8px; align-items: center;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---------- sections ---------- */
.section { padding-block: 28px 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font-size: var(--step-2); font-weight: 800; }
.section-head p { color: var(--muted); font-size: var(--step--1); }

.cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cat {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden;
  color: #fff; aspect-ratio: 16 / 9; max-width: 100%;
}
.cat img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.cat:hover img { transform: scale(1.04); }
.cat:hover { text-decoration: none; }
.cat::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--shade), rgba(0,0,0,0) 62%); }
.cat div { position: absolute; z-index: 1; inset-inline: 16px; bottom: 12px; }
.cat strong { display: block; font-size: var(--step-1); font-weight: 800; color: #fff; }
.cat span { font-size: var(--step--1); color: rgba(255,255,255,.88); }

/* release list */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.row {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) 120px 110px 104px 26px;
  gap: 16px; align-items: center; padding: 14px 18px; color: var(--ink);
}
.row + .row { border-top: 1px solid var(--line); }
.row:hover { background: var(--bg); text-decoration: none; }
.mono-tile {
  width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: 0.9rem; direction: ltr;
  background: var(--accent-soft); color: var(--accent);
}
.row h3 { font-size: var(--step-1); font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row p { color: var(--muted); font-size: var(--step--1); }
.badge {
  font-size: 0.72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  background: var(--signal-soft); color: var(--signal); letter-spacing: .02em;
}
.cell small { display: block; font-size: 0.72rem; color: var(--muted); }
.cell { font-size: var(--step--1); }
.chev { width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; }
.empty { padding: 22px 18px; color: var(--muted); }

/* process */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; counter-reset: s; }
.steps li { counter-increment: s; border-top: 2px solid var(--accent); padding-top: 14px; }
.steps li::before { content: counter(s, persian) "."; font-weight: 800; color: var(--accent); margin-inline-end: 6px; }
.steps strong { font-weight: 800; }
.steps p { color: var(--muted); font-size: var(--step--1); margin-top: 4px; }

/* footer */
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot .wrap { padding-block: 22px; display: flex; gap: 12px 28px; flex-wrap: wrap; justify-content: space-between; font-size: var(--step--1); color: var(--muted); }
.foot nav { display: flex; gap: 18px; }

/* ---------- software page ---------- */
.crumbs { font-size: var(--step--1); color: var(--muted); padding-block: 18px 0; }
.crumbs a { color: var(--muted); }
.crumbs span { margin-inline: 6px; }
.app-head { display: flex; gap: 18px; align-items: center; padding-block: 18px 22px; flex-wrap: wrap; }
.app-head .mono-tile { width: 64px; height: 64px; font-size: 1.15rem; border-radius: 14px; }
.app-head h1 { font-size: var(--step-3); font-weight: 900; }
.app-head p { color: var(--muted); }
.banner { border-radius: 14px; overflow: hidden; max-width: 100%; }
.banner img { width: 100%; aspect-ratio: 16 / 5; object-fit: cover; }
.app-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; padding-block: 26px 48px; }
.prose { display: grid; gap: 16px; max-width: 42em; }
.prose h2 { font-size: var(--step-2); font-weight: 800; margin-top: 8px; }
.prose ul { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 6px; }
.code { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; }
.code code { font-family: var(--mono); font-size: 0.85rem; direction: ltr; display: block; white-space: pre; text-align: left; }

.dl { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 16px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 800; font-size: var(--step-1);
  padding: 13px 18px; border-radius: 10px; border: 0; cursor: pointer;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; }
.meta { display: grid; gap: 0; margin: 0; }
.meta div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: var(--step--1); }
.meta div:last-child { border-bottom: 0; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; font-weight: 600; text-align: end; min-width: 0; overflow-wrap: anywhere; }
.hash { display: grid; gap: 8px; }
.hash-label { display: flex; justify-content: space-between; align-items: center; font-size: var(--step--1); color: var(--muted); }
.hash code {
  font-family: var(--mono); font-size: 0.78rem; direction: ltr; display: block; text-align: left;
  background: var(--bg); border-radius: 8px; padding: 10px 12px; overflow-wrap: anywhere; line-height: 1.6;
}
.copy { font: inherit; font-size: var(--step--1); color: var(--accent); background: none; border: 0; cursor: pointer; padding: 2px 4px; }
.verified { display: flex; gap: 8px; align-items: center; font-size: var(--step--1); color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; }
.verified svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.4; flex: none; }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); padding-block: 28px; }
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: 46px minmax(0, 1fr) 96px 22px; }
  .row .c-cat, .row .c-size { display: none; }
  .app-grid { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .nav { display: none; }
  .search { max-width: none; flex-basis: 100%; }
  .cats { grid-template-columns: minmax(0, 1fr); }
  .cat { aspect-ratio: 21 / 9; }
  .row { grid-template-columns: 40px minmax(0, 1fr) 74px; gap: 12px; padding: 12px 14px; }
  .row .chev { display: none; }
  .mono-tile { width: 40px; height: 40px; font-size: .8rem; }
  .banner img { aspect-ratio: 16 / 7; }
  .hero figure img { aspect-ratio: 16 / 10; }
}
@media (prefers-reduced-motion: reduce) {
  .cat img { transition: none; }
}
