:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --surface: #ffffff;
  --border: #e4e8ef;
  --border-strong: #cfd6e0;
  --text: #0b1220;
  --text-muted: #4b5668;
  --text-soft: #6b7689;
  --primary: #1e3a8a;
  --primary-hover: #1a3278;
  --primary-contrast: #ffffff;
  --accent: #2563eb;

  --radius: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.05);
  --shadow-md: 0 4px 14px rgba(11, 18, 32, 0.08);

  --max-w: 880px;

  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;

  --font-ar: "Segoe UI", "Tahoma", "Geeza Pro", "Noto Sans Arabic",
             "Noto Naskh Arabic", "Cairo", "Arial", system-ui, sans-serif;
  --font-en: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1020;
    --bg-alt: #0e162a;
    --surface: #111b34;
    --border: #1d2a48;
    --border-strong: #2a3a5e;
    --text: #eaf0fa;
    --text-muted: #a4b1c7;
    --text-soft: #8593ac;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-contrast: #0a1020;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

[lang="ar"], [dir="rtl"] { font-family: var(--font-ar); line-height: 1.85; }

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

code { font-family: var(--font-mono); font-size: 0.9em; }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-2);
}

/* HEADER */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 700;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-weight: 800;
  font-family: var(--font-en);
}
.brand-name { font-size: 1.05rem; }

.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.nav a { color: var(--text-muted); font-size: 0.95rem; }
.nav a:hover { color: var(--text); text-decoration: none; }

/* HERO */
.hero {
  padding: var(--space-5) 0 var(--space-4);
  background:
    radial-gradient(700px 280px at 50% -20%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 60%);
}
.hero-inner { text-align: center; }
.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3rem);
  margin: 0 0 var(--space-2);
  letter-spacing: -0.02em;
  font-weight: 800;
}
.lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto var(--space-3);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.97rem;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--primary);
  color: var(--primary-contrast);
}
.btn-primary:hover { background: var(--primary-hover); }

/* SECTIONS */
.section { padding: var(--space-4) 0; }
.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}
.section-title {
  font-size: 1.4rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
}
.prose {
  max-width: 640px;
  color: var(--text-muted);
}

/* APP CARD */
.app-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.app-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(11, 18, 32, 0.12);
}
.app-icon {
  width: 96px; height: 96px;
  border-radius: 22px;
  display: block;
  object-fit: cover;
  box-shadow: var(--shadow-md);
  background: var(--bg-alt);
}
.app-title { margin: 0 0 0.3rem; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.app-pkg { margin: 0 0 0.6rem; color: var(--text-soft); font-size: 0.88rem; }
.app-pkg code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
}
.app-tagline {
  margin: 0 0 var(--space-2);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
}
.app-actions { margin-top: var(--space-2); }

/* NOTICE */
.notice {
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--primary);
  border-radius: var(--radius);
  font-size: 0.93rem;
  color: var(--text-muted);
}
.notice p { margin: 0 0 0.5rem; }
.notice p:last-child { margin-bottom: 0; }

/* FOOTER */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: var(--space-3) 0;
  margin-top: var(--space-4);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
  color: var(--text-soft);
  font-size: 0.9rem;
}
.footer-inner a { color: var(--text-muted); }
.footer-inner a:hover { color: var(--text); }
.footer-inner p { margin: 0; }

/* RESPONSIVE */
@media (max-width: 640px) {
  .app-card { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .app-icon { margin: 0 auto; }
  .notice { text-align: start; }
}

/* FOCUS */
a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}
