/* ==========================================================================
   ArCode Standard — الموقع الرسمي
   لوحة الألوان والمقاييس مطابقة لصفحة ArCode-Core:
   https://arcode-standard.github.io/ArCode-Core/index.html
   ========================================================================== */

/* ---------- 1. الرموز التصميمية (متطابقة مع ArCode-Core) ---------- */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --accent: #0f172a;
  --accent-light: #1e293b;
  --accent-blue: #2563eb;
  --accent-blue-light: #3b82f6;
  --accent-green: #059669;
  --accent-orange: #ea580c;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  --wrap: 1140px;
  --gap: clamp(1rem, 2.4vw, 1.75rem);

  --font-ar: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --font-en: "Inter", "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

/* ---------- 2. الوضع الداكن (مطابق لـ ArCode-Core عبر data-theme) ---------- */
[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-elevated: #1a1a1a;
  --border: #262626;
  --border-light: #1a1a1a;
  --text-primary: #fafafa;
  --text-secondary: #a3a3a3;
  --text-tertiary: #737373;
  --accent: #f5f5f5;
  --accent-light: #e5e5e5;
  --accent-blue: #3b82f6;
  --accent-blue-light: #60a5fa;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
}

/* احتياطي لزوّار بلا JavaScript: اتّباع تفضيل النظام.
   القيم مكرّرة عمدًا لتبقى مطابقة للكتلة أعلاه (لا مُعالِج CSS). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a;
    --surface: #111111;
    --surface-elevated: #1a1a1a;
    --border: #262626;
    --border-light: #1a1a1a;
    --text-primary: #fafafa;
    --text-secondary: #a3a3a3;
    --text-tertiary: #737373;
    --accent: #f5f5f5;
    --accent-light: #e5e5e5;
    --accent-blue: #3b82f6;
    --accent-blue-light: #60a5fa;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
  }
}

/* ---------- 3. إعادة الضبط ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-block-start: 80px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-ar);
  font-size: clamp(1rem, .96rem + .2vw, 1.06rem);
  line-height: 1.75;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

[lang="en"] body, html[lang="en"] body { font-family: var(--font-en); }

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-blue); text-decoration: none; }
a:hover { color: var(--accent-blue-light); }

h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.8vw, 3.2rem); }
h2 { font-size: clamp(1.45rem, 1.2rem + 1.3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 1.05rem + .4vw, 1.3rem); }
p { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-inline-start: 1.4rem; }

:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; border-radius: 4px; }

::selection { background: color-mix(in srgb, var(--accent-blue) 22%, transparent); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1 !important; translate: none !important; }
}

/* ---------- 4. أدوات ---------- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.section { padding-block: clamp(3.2rem, 6vw, 5.5rem); }
.section--soft { background: var(--surface); border-block: 1px solid var(--border); }
.center { text-align: center; }
.muted { color: var(--text-secondary); }
.faint { color: var(--text-tertiary); font-size: .88rem; }
.mono { font-family: var(--mono); font-size: .92em; }

.skip {
  position: absolute; inset-inline-start: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff; padding: .7rem 1.2rem;
  border-radius: var(--radius); font-weight: 700;
}
.skip:focus { inset-inline-start: 1rem; top: 1rem; }

/* ---------- 5. الترويسة (نمط ArCode-Core) ---------- */
.hdr {
  position: sticky; inset-block-start: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-block-end: 1px solid var(--border);
}
.hdr__in { display: flex; align-items: center; gap: 10px; min-height: 64px; flex-wrap: wrap; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-inline-end: auto; }
.brand img { width: 30px; height: 30px; }
.brand span { font-family: var(--font-en); font-weight: 700; font-size: 1.02rem; color: var(--text-primary); }
.brand small { display: block; font-family: var(--font-ar); font-size: .72rem; font-weight: 500; color: var(--text-tertiary); }

.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav a {
  padding: 8px 14px; border-radius: var(--radius);
  color: var(--text-secondary); font-size: .9rem; font-weight: 500;
  font-family: var(--font-en);
}
[lang="ar"] .nav a { font-family: var(--font-ar); font-weight: 600; }
.nav a:hover { color: var(--text-primary); background: var(--border-light); }
.nav a[aria-current="true"] { color: var(--accent-blue); }

.burger {
  display: none; width: 36px; height: 36px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); cursor: pointer; font-size: 1.05rem; line-height: 1;
}
.burger:hover { background: var(--border-light); color: var(--text-primary); }

@media (max-width: 900px) {
  .burger { display: grid; place-items: center; }
  .nav {
    display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 2px;
    padding-block: .6rem 1rem; border-block-start: 1px solid var(--border);
  }
  .nav.is-open { display: flex; }
}

/* ---------- 6. أزرار النمط الموحّد ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: 10px 20px; border-radius: var(--radius);
  font-weight: 600; font-size: .9rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  font-family: var(--font-en);
  transition: var(--transition);
}
[lang="ar"] .btn { font-family: var(--font-ar); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-light); color: #fff; }
.btn--blue { background: var(--accent-blue); color: #fff; }
.btn--blue:hover { background: var(--accent-blue-light); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--text-primary); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--text-tertiary); background: var(--border-light); color: var(--text-primary); }
.btn--sm { padding: 7px 14px; font-size: .85rem; }

/* ---------- 7. البطل (متمركز كنمط ArCode-Core) ---------- */
.hero { padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(2.5rem, 5vw, 4rem); text-align: center; }
.hero__inner { max-width: 780px; margin-inline: auto; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; margin-block-end: 22px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 50px; font-size: .85rem; color: var(--text-secondary); font-weight: 500;
}
.hero-badge-dot {
  width: 6px; height: 6px; background: var(--accent-green);
  border-radius: 50%; animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.hero__brand {
  font-family: var(--font-en); font-weight: 900; letter-spacing: .02em;
  font-size: clamp(1.5rem, 3.6vw, 2.6rem); color: var(--text-primary);
  margin-block-end: 14px;
}
.hero h1 { margin-block-end: 18px; letter-spacing: -.02em; }
[lang="ar"] .hero h1 { letter-spacing: 0; }
.gradient {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-light));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero__sub {
  font-size: 1.12rem; color: var(--text-secondary);
  max-width: 640px; margin: 0 auto 34px; line-height: 1.7;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.hero__panel {
  margin-block-start: clamp(2.5rem, 5vw, 3.5rem);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: clamp(1.4rem, 3vw, 2rem);
  box-shadow: var(--shadow-sm); text-align: start;
}
.hero__panel h2 { font-size: 1rem; margin-block-end: 1rem; color: var(--text-secondary); font-weight: 600; }
.pill-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pill-list li { display: flex; align-items: center; gap: 10px; font-size: .93rem; margin: 0; color: var(--text-primary); }
.pill-list .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-blue); flex: 0 0 auto; }
.pill-list .dot--green { background: var(--accent-green); }
.pill-list .dot--orange { background: var(--accent-orange); }
.pill-list .dot--gray { background: var(--text-tertiary); }

/* ---------- 8. شريط الأرقام ---------- */
.stats { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.6rem 1.2rem; text-align: center;
  box-shadow: var(--shadow-sm); transition: var(--transition);
}
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat__n {
  font-size: clamp(1.6rem, 1.25rem + 1.5vw, 2.3rem); font-weight: 800;
  color: var(--accent-blue); line-height: 1.15; font-variant-numeric: tabular-nums;
  font-family: var(--font-en);
}
.stat__l { font-size: .9rem; color: var(--text-secondary); margin-block-start: .35rem; font-weight: 500; }

/* ---------- 9. عناوين الأقسام ---------- */
.sec-head { max-width: 72ch; margin-block-end: clamp(1.8rem, 4vw, 2.8rem); }
.sec-head.center { margin-inline: auto; }
.sec-head p { color: var(--text-secondary); margin-block-end: 0; }
.kicker {
  display: block; font-family: var(--font-en); font-size: .78rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent-blue); margin-block-end: .5rem;
}

/* ---------- 10. بطاقات المشاريع ---------- */
.cards { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.6rem;
  box-shadow: var(--shadow-sm); transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--text-tertiary); }
.card__top { display: flex; align-items: center; gap: 14px; margin-block-end: 1rem; }
.card__icon {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: var(--radius-md);
  display: grid; place-items: center; font-size: 1.3rem;
  background: var(--border-light);
}
.card h3 { margin-block-end: .2rem; font-size: 1.15rem; font-family: var(--font-en); }
[lang="ar"] .card h3 { font-family: var(--font-ar); }
.card p { color: var(--text-secondary); font-size: .94rem; }
.card__foot { margin-block-start: auto; padding-block-start: 1.1rem; display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .73rem; font-weight: 600; padding: 3px 10px;
  border-radius: 50px; border: 1px solid var(--border); white-space: nowrap;
  font-family: var(--font-en);
}
[lang="ar"] .tag { font-family: var(--font-ar); }
.tag--live { color: var(--accent-green); border-color: color-mix(in srgb, var(--accent-green) 40%, transparent); background: color-mix(in srgb, var(--accent-green) 10%, transparent); }
.tag--dev { color: var(--accent-orange); border-color: color-mix(in srgb, var(--accent-orange) 40%, transparent); background: color-mix(in srgb, var(--accent-orange) 10%, transparent); }
.tag--plan { color: var(--text-tertiary); background: var(--border-light); }

/* ---------- 11. القيم ---------- */
.values { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.value {
  padding: 1.5rem; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); transition: var(--transition);
}
.value:hover { box-shadow: var(--shadow-md); }
.value h3 { font-size: 1.02rem; }
.value p { margin-block-end: 0; color: var(--text-secondary); font-size: .93rem; }

/* ---------- 12. خارطة الطريق ---------- */
.road { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.road__row { display: grid; gap: .35rem 1.2rem; align-items: baseline; padding: 1.15rem 1.4rem; background: var(--surface); grid-template-columns: 1fr; }
@media (min-width: 760px) { .road__row { grid-template-columns: 180px 1fr auto; } }
.road__k { font-weight: 700; color: var(--text-primary); }
.road__v { color: var(--text-secondary); margin: 0; font-size: .94rem; }
.road__badge { justify-self: start; }
@media (min-width: 760px) { .road__badge { justify-self: end; } }

/* ---------- 13. خطوات المساهمة ---------- */
.steps { counter-reset: s; display: grid; gap: .8rem; list-style: none; padding: 0; margin: 0; max-width: 620px; margin-inline: auto; }
.steps li { counter-increment: s; position: relative; padding-inline-start: 2.9rem; margin: 0; min-height: 2.1rem; display: flex; align-items: center; text-align: start; }
.steps li::before {
  content: counter(s); position: absolute; inset-inline-start: 0; top: 50%; translate: 0 -50%;
  width: 2rem; height: 2rem; border-radius: var(--radius);
  display: grid; place-items: center; font-family: var(--font-en);
  background: var(--accent); color: #fff; font-weight: 700; font-size: .88rem;
}

/* ---------- 14. دعوة أخيرة ---------- */
.cta {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: clamp(2rem, 5vw, 3.2rem);
  text-align: center; box-shadow: var(--shadow-sm);
}
.cta h2 { color: var(--text-primary); }
.cta p { color: var(--text-secondary); max-width: 60ch; margin-inline: auto; }
.cta__btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-block-start: 1.6rem; }

/* ---------- 15. التذييل ---------- */
.ftr { border-block-start: 1px solid var(--border); padding-block: 2.4rem; background: var(--surface); }
.ftr__in { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; justify-content: space-between; }
.ftr__links { display: flex; flex-wrap: wrap; gap: 1rem; }
.ftr__links a { color: var(--text-secondary); font-size: .9rem; font-family: var(--font-en); }
[lang="ar"] .ftr__links a { font-family: var(--font-ar); }
.ftr__links a:hover { color: var(--accent-blue); }

/* ---------- 16. زر اللغة والمظهر ---------- */
.theme-btn {
  width: 36px; height: 36px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); cursor: pointer; font-size: .95rem;
  display: grid; place-items: center; flex: 0 0 auto; transition: var(--transition);
}
.theme-btn:hover { background: var(--border-light); color: var(--text-primary); }
.lang {
  padding: 8px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-primary); font-family: var(--font-en);
  font-size: .85rem; font-weight: 600; white-space: nowrap; transition: var(--transition);
}
.lang:hover { border-color: var(--text-tertiary); background: var(--border-light); }

/* ---------- 17. حركات الظهور ---------- */
.reveal { opacity: 0; translate: 0 16px; transition: opacity .55s cubic-bezier(.4, 0, .2, 1), translate .55s cubic-bezier(.4, 0, .2, 1); }
.reveal.is-in { opacity: 1; translate: 0 0; }

/* ---------- 18. الطباعة ---------- */
@media print {
  .hdr, .ftr, .burger { display: none; }
  .card, .value, .stat { box-shadow: none; }
}
