:root {
  --bg: #0b0f1a;
  --surface: #121a2b;
  --border: #243049;
  --text: #e8eefc;
  --muted: #9aa8c7;
  --accent: #5b8cff;
  --accent-2: #3dd6c5;
  --danger: #ff6b7a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html[dir="rtl"] body {
  font-family: "Vazirmatn", "Tahoma", "Segoe UI", system-ui, sans-serif;
}

html[dir="ltr"] body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.8;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(91, 140, 255, 0.12), transparent 40%),
    radial-gradient(circle at 20% 70%, rgba(61, 214, 197, 0.1), transparent 35%),
    linear-gradient(var(--bg), var(--bg));
  pointer-events: none;
  z-index: -1;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
}

.topbar {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.topnav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.topnav a:hover { color: var(--accent-2); }

.hero { text-align: center; padding: 2rem 0 2.5rem; }

.section { margin-bottom: 2.75rem; }

.section-title {
  font-size: 1.45rem;
  margin-bottom: 0.85rem;
  color: var(--text);
  border-right: 3px solid var(--accent);
  padding-right: 0.75rem;
}

.section-text {
  color: var(--muted);
  margin-bottom: 1rem;
  text-align: justify;
}

.owner-panel .owner-box {
  background: rgba(18, 26, 43, 0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
}

.owner-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-2);
  margin-bottom: 0.25rem;
}

.owner-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.actions-start { justify-content: flex-start; }

.card-featured {
  border-color: rgba(91, 140, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(91, 140, 255, 0.15);
}

.card-tag {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }

.services-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.65rem;
}

.services-list li {
  background: rgba(18, 26, 43, 0.75);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.services-list li::before {
  content: "◆ ";
  color: var(--accent-2);
}

.site-footer {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

.site-footer a { color: var(--accent-2); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.footer-brand { color: var(--text); margin-bottom: 0.5rem; }
.footer-legal { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.75rem; }
.footer-links { color: var(--muted); font-size: 0.9rem; }
.footer-links span { margin: 0 0.35rem; opacity: 0.5; }

.badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent-2);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.lead {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 36rem;
  margin: 0 auto 1.75rem;
}

.actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #7aa6ff);
  color: #fff;
  box-shadow: 0 8px 24px rgba(91, 140, 255, 0.35);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(18, 26, 43, 0.6);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.card {
  background: rgba(18, 26, 43, 0.85);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  backdrop-filter: blur(8px);
  text-align: right;
}

html[dir="rtl"] .card { text-align: right; }

.card h2,
.card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.75rem; }
.card a { color: var(--accent-2); text-decoration: none; font-weight: 600; }
.card a:hover { text-decoration: underline; }

/* Error pages */
.error-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.error-box {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 520px;
  width: 100%;
  background: rgba(18, 26, 43, 0.95);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  color: var(--text);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.error-code {
  font-size: clamp(4rem, 12vw, 6rem);
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 0.5rem;
  direction: ltr;
  unicode-bidi: isolate;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .error-code {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

.error-title {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.error-desc {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.error-box .btn { margin-top: 0.25rem; }
