/* `hidden` must win over component display rules (e.g. .dl-card{display:flex}). */
[hidden] { display: none !important; }

/* DeepSeek-style site: white canvas, near-black type, one blue accent, pill buttons.
   Logical properties keep the same sheet working for LTR (ru/en) and RTL (fa). */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f7f8fa;
  --card: #ffffff;
  --text: #0f1115;
  --muted: #6b7280;
  --line: #e8eaed;
  --accent: #4d6bfe;
  --accent-strong: #3a58f0;
  --accent-text: #ffffff;
  --radius: 16px;
  --max: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1017;
    --surface: #151922;
    --card: #151922;
    --text: #f2f4f8;
    --muted: #9aa3b2;
    --line: #232833;
    --accent: #6b86ff;
    --accent-strong: #7f97ff;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", "Vazirmatn", "Noto Sans Arabic", "PingFang SC", "Microsoft YaHei", sans-serif;
  text-align: start;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; color: var(--accent-strong); }

main { width: min(var(--max), calc(100vw - 40px)); margin: 0 auto; }

/* Header */
header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 20px;
  border-block-end: 1px solid transparent;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.2px;
  color: var(--text);
}
.brand .logo { width: 30px; height: 30px; border-radius: 8px; }
.brand:hover { color: var(--text); }

nav.links { display: flex; align-items: center; gap: 26px; font-size: 15px; }
nav.links a { color: var(--muted); }
nav.links a:hover { color: var(--text); }
nav.links a[aria-current="page"] { color: var(--text); font-weight: 600; }
nav.links a.app {
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 14px;
}
nav.links a.app:hover { border-color: var(--text); }
nav.links a.app.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
nav.links a.app.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.lang { display: flex; gap: 4px; font-size: 13px; }
.lang a {
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  border: 1px solid transparent;
}
.lang a:hover { color: var(--text); border-color: var(--line); }

/* Hero */
.hero { text-align: center; padding-block: 88px 56px; }
.hero .hero-logo {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  margin-block-end: 28px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 12%);
}
.hero h1 {
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.08;
  letter-spacing: -1.8px;
  font-weight: 700;
  margin: 0 0 18px;
}
.hero .lead {
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.5;
  color: var(--text);
  margin: 0 auto 16px;
  max-width: 44ch;
}
.hero .intro {
  color: var(--muted);
  margin: 0 auto 34px;
  max-width: 56ch;
  font-size: 16px;
}

.actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  font-size: 15px;
  padding: 13px 26px;
  border-radius: 999px;
  transition: background 0.15s ease;
}
.button:hover { background: var(--accent-strong); color: var(--accent-text); }

.button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.button.secondary:hover { border-color: var(--text); color: var(--text); }

/* Sections */
section { padding-block: 56px; }
h2 {
  font-size: 26px;
  letter-spacing: -0.6px;
  font-weight: 650;
  margin: 0 0 24px;
  text-align: center;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.card h3 { font-size: 17px; letter-spacing: -0.2px; margin: 0 0 8px; font-weight: 650; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

.steps { counter-reset: step; display: grid; gap: 14px; max-width: 760px; margin: 0 auto; }
.steps .card { position: relative; padding-inline-start: 66px; }
.steps .card::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  inset-inline-start: 22px;
  inset-block-start: 24px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* Download */
.dl-card { display: flex; flex-direction: column; gap: 6px; }
.dl-card h3 { margin: 0; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.dl-card .button { align-self: flex-start; }
.sha { margin-block-start: 16px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.sha code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.soon {
  display: inline-block;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  align-self: flex-start;
}
.notes { color: var(--muted); font-size: 15px; max-width: 760px; margin: 0 auto; }
.notes ol { padding-inline-start: 22px; margin: 8px 0 0; }
.notes li { margin-block: 10px; }

/* Code */
pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
  font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  margin: 0 auto;
  max-width: 760px;
}

.base-url { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.base-url code {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 20px;
  direction: ltr;
  font: 14px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.section-note { text-align: center; margin-block-start: 18px; }

/* Footer */
footer.site {
  border-block-start: 1px solid var(--line);
  margin-block-start: 48px;
  padding-block: 28px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  /* Brand wordmark wraps next to the nav pills; keep the icon only. */
  .brand .brand-name { display: none; }
  .hero { padding-block: 56px 40px; }
  section { padding-block: 36px; }
  nav.links { gap: 16px; font-size: 14px; }
  /* Hide the page links only; the language switch sits inside .lang and must stay. */
  nav.links > a:not(.app) { display: none; }
  nav.links > a[aria-current="page"] { display: inline-flex; }
}
