/* ============================================================
   VideoRayan — Design System (v2, complete redesign)
   Modern dark theme · supports RTL and LTR via [dir]
   ============================================================ */
:root {
  --bg: #070b14;
  --bg-soft: #0b1120;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-strong: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eaf0fa;
  --muted: #8ea0bd;
  --brand: #2dd4a8;
  --brand-2: #4f8dff;
  --grad: linear-gradient(120deg, #2dd4a8, #4f8dff);
  --danger: #f87171;
  --radius: 18px;
  --max: 1080px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(79, 141, 255, 0.14), transparent 60%),
    radial-gradient(900px 460px at 10% -5%, rgba(45, 212, 168, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}
[dir="ltr"] body { font-family: "Inter", "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.container { max-width: var(--max); margin: 0 auto; padding-inline: 20px; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 20, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 18px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--grad);
  display: grid; place-items: center;
  font-size: 1.1rem; color: #04121c;
}
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 0.72rem; }
.nav-links { display: flex; gap: 4px; margin-inline-start: auto; align-items: center; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px;
  color: var(--muted); font-size: 0.92rem; transition: 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--panel-strong); }
.nav-links a.cta {
  color: #04121c; font-weight: 700;
  background: var(--grad);
}
.nav-links a.cta:hover { filter: brightness(1.1); }
.lang-switch { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; color: var(--muted); font-size: 0.85rem; }
.lang-switch:hover { color: var(--text); }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 6px 12px; font-size: 1rem; cursor: pointer; }
@media (max-width: 860px) {
  .nav-links { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .nav-links.open { display: flex; }
  .nav { flex-wrap: wrap; }
  .menu-btn { display: block; margin-inline-start: auto; }
  .lang-switch { order: 5; }
}

/* ---------- Hero ---------- */
.hero { padding: 84px 0 40px; text-align: center; }
.hero .pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 999px; padding: 7px 16px;
  color: var(--muted); font-size: 0.85rem; margin-bottom: 22px;
}
.hero .pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 12px var(--brand); }
.hero h1 { font-size: clamp(1.7rem, 4.2vw, 2.7rem); line-height: 1.45; margin: 0 0 14px; font-weight: 800; }
.hero h1 .grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero p.lead { color: var(--muted); max-width: 640px; margin: 0 auto 30px; font-size: 1.02rem; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 26px; border-radius: 14px; border: 0;
  font-family: inherit; font-size: 0.95rem; font-weight: 700; cursor: pointer;
  transition: 0.2s;
}
.btn.primary { background: var(--grad); color: #04121c; }
.btn.primary:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn.ghost { background: var(--panel-strong); color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: rgba(255,255,255,0.1); }
.btn.small { padding: 9px 18px; font-size: 0.86rem; border-radius: 12px; }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-head h2 { font-size: 1.5rem; margin: 0 0 10px; font-weight: 800; }
.section-head p { color: var(--muted); margin: 0; font-size: 0.96rem; }
.grid { display: grid; gap: 16px; }
.grid.g2 { grid-template-columns: repeat(2, 1fr); }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .grid.g2, .grid.g3 { grid-template-columns: 1fr; } }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 22px;
  transition: 0.25s;
}
.card:hover { border-color: rgba(45, 212, 168, 0.35); transform: translateY(-3px); }
.card .icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.3rem;
  background: rgba(45, 212, 168, 0.12); margin-bottom: 14px;
}
.card h3 { margin: 0 0 8px; font-size: 1.03rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.card.wide { grid-column: 1 / -1; }

/* ---------- Feature list / steps ---------- */
.steps { counter-reset: step; display: grid; gap: 14px; max-width: 640px; margin: 0 auto; }
.step {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px 20px;
}
.step::before {
  counter-increment: step; content: counter(step);
  flex: 0 0 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--grad); color: #04121c; font-weight: 800;
}
.step b { display: block; margin-bottom: 3px; }
.step span { color: var(--muted); font-size: 0.9rem; }

/* ---------- Roles ---------- */
.role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .role-cards { grid-template-columns: 1fr; } }
.role { text-align: center; padding: 26px 18px; }
.role .emoji { font-size: 2rem; display: block; margin-bottom: 8px; }
.role b { font-size: 1.05rem; }
.role p { color: var(--muted); font-size: 0.88rem; margin: 6px 0 0; }

/* ---------- Code blocks ---------- */
.code-wrap { direction: ltr; text-align: left; }
.code-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.code-tabs button {
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  border-radius: 10px; padding: 6px 14px; cursor: pointer; font-family: inherit; font-size: 0.82rem;
}
.code-tabs button.active { color: var(--brand); border-color: rgba(45,212,168,.4); }
pre.code {
  background: #0a1626; border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px;
  overflow-x: auto; font-size: 0.82rem; line-height: 1.7;
  font-family: Consolas, "Courier New", monospace; color: #c9d7f2;
  margin: 0;
}
pre.code .c { color: #5d7599; }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table.api { width: 100%; border-collapse: collapse; background: var(--panel); font-size: 0.88rem; }
table.api th { text-align: start; background: var(--panel-strong); color: var(--muted); font-weight: 600; }
table.api th, table.api td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
table.api tr:last-child td { border-bottom: 0; }
table.api code { direction: ltr; display: inline-block; font-family: Consolas, monospace; font-size: 0.82em; color: var(--brand); }
.mth { display: inline-block; direction: ltr; font-family: Consolas, monospace; font-size: 0.75rem; font-weight: 700; border-radius: 6px; padding: 1px 8px; }
.mth.GET { background: rgba(79,141,255,.15); color: #7aa5ff; }
.mth.POST { background: rgba(45,212,168,.15); color: var(--brand); }
.mth.DELETE { background: rgba(248,113,113,.15); color: var(--danger); }

/* ---------- Forms ---------- */
.form-card { max-width: 560px; margin: 0 auto; }
.field label { display: block; color: var(--muted); font-size: 0.88rem; margin: 16px 0 7px; }
.field input {
  width: 100%; padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--text); font-size: 0.95rem; font-family: inherit;
}
.field input:focus { outline: 2px solid var(--brand-2); border-color: transparent; }
.roles-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.role-pick {
  padding: 11px 8px; border-radius: 12px; text-align: center;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); cursor: pointer; font-family: inherit; font-size: 0.92rem;
}
.role-pick.active { border-color: var(--brand); color: var(--brand); background: rgba(45,212,168,.1); font-weight: 700; }
.msg { margin-top: 14px; padding: 11px 14px; border-radius: 12px; font-size: 0.88rem; display: none; white-space: pre-wrap; word-break: break-word; }
.msg.ok { display: block; background: rgba(45,212,168,.1); color: var(--brand); }
.msg.err { display: block; background: rgba(248,113,113,.1); color: var(--danger); }
.link-out {
  margin-top: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--bg-soft); border: 1px dashed var(--line);
  direction: ltr; text-align: left; font-size: 0.85rem; word-break: break-all;
  color: var(--brand);
}

/* ---------- Stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; text-align: center; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 22px 10px; }
.stat b { font-size: 1.6rem; display: block; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--muted); font-size: 0.85rem; }

/* ---------- FAQ ---------- */
details.faq {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 20px; margin-bottom: 10px;
}
details.faq summary { cursor: pointer; font-weight: 700; }
details.faq p { color: var(--muted); font-size: 0.9rem; margin: 10px 0 0; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, rgba(45,212,168,.12), rgba(79,141,255,.12));
  border: 1px solid var(--line); border-radius: 22px;
  text-align: center; padding: 44px 24px;
}
.cta-band h2 { margin: 0 0 8px; font-size: 1.4rem; }
.cta-band p { color: var(--muted); margin: 0 0 22px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 34px 0 44px; color: var(--muted); font-size: 0.88rem; }
.foot-grid { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-grid a { display: block; padding: 3px 0; color: var(--muted); }
.foot-grid a:hover { color: var(--text); }
.foot-note { margin-top: 26px; color: #5f7291; font-size: 0.8rem; }

/* ---------- Room shell notice ---------- */
.badge-role { color: var(--brand); font-weight: 700; }
