:root {
  color-scheme: dark;
  --bg: #0c0a12;
  --bg-2: #131020;
  --card: rgba(255, 255, 255, .045);
  --card-border: rgba(255, 255, 255, .09);
  --ink: #f6f1f4;
  --muted: #a89cab;
  --accent: #ff3b5c;
  --accent-2: #ff7a5c;
  --accent-soft: rgba(255, 59, 92, .13);
  --line: rgba(255, 255, 255, .1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(255, 59, 92, .16), transparent 60%),
    radial-gradient(900px 480px at 0% 110%, rgba(122, 59, 255, .12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'Alexandria', 'Segoe UI', Tahoma, system-ui, sans-serif;
  line-height: 1.8;
  min-height: 100vh;
}

/* ===== الشريط العلوي ===== */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(12, 10, 18, .72);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
}
.logo { position: relative; width: 34px; height: 34px; display: inline-block; }
.logo svg { width: 100%; height: 100%; display: block; }
.logo::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  animation: sonar 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes sonar {
  0% { transform: scale(.85); opacity: .9; }
  100% { transform: scale(1.65); opacity: 0; }
}
.logo .ring { fill: none; stroke: var(--accent); stroke-width: 2; }
.logo .beat { fill: none; stroke: var(--accent-2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
nav a { color: var(--muted); text-decoration: none; margin-inline-start: 14px; font-size: .95rem; }
nav a:hover { color: var(--accent); }

main { max-width: 860px; margin: 0 auto; padding: 24px 16px 72px; }

/* ===== بطل الصفحة الرئيسية ===== */
.hero { position: relative; text-align: center; padding: 44px 8px 8px; }
.hero-eyebrow {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: .85rem;
}
.hero h1 {
  font-size: clamp(2rem, 6.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.35;
  margin: 18px 0 6px;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .sub { color: var(--muted); max-width: 520px; margin: 0 auto; }
.ecg { display: block; width: min(560px, 92%); margin: 10px auto 4px; }
.ecg path.base {
  fill: none;
  stroke: rgba(255, 59, 92, .25);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ecg path.draw {
  fill: none;
  stroke: url(#ecgGrad);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: ecgdraw 3.2s linear infinite;
  filter: drop-shadow(0 0 6px rgba(255, 59, 92, .55));
}
@keyframes ecgdraw {
  0% { stroke-dashoffset: 1200; opacity: 1; }
  80% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
.orb {
  position: absolute;
  inset-inline-start: 6%;
  top: 40px;
  width: 64px;
  height: 64px;
  opacity: .9;
  animation: floaty 5s ease-in-out infinite;
}
.orb.two { inset-inline-start: auto; inset-inline-end: 7%; top: 120px; width: 46px; height: 46px; animation-delay: 1.4s; opacity: .7; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-14px) rotate(4deg); }
}

/* ===== شبكة الأدوات ===== */
.section-title { font-size: 1.15rem; font-weight: 700; margin: 34px 0 4px; }
.section-sub { color: var(--muted); margin: 0 0 6px; font-size: .95rem; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  display: block;
  backdrop-filter: blur(6px);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card::before {
  content: '';
  position: absolute;
  inset-inline-start: -40%;
  top: -60%;
  width: 70%;
  height: 120%;
  background: radial-gradient(circle, rgba(255, 59, 92, .22), transparent 70%);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.card:hover { transform: translateY(-4px); border-color: rgba(255, 59, 92, .5); box-shadow: 0 12px 34px rgba(255, 59, 92, .14); }
.card:hover::before { opacity: 1; }
.card h2 { font-size: 1.05rem; margin: 12px 0 4px; }
.card p { color: var(--muted); font-size: .88rem; margin: 0; line-height: 1.7; }
.ticon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 59, 92, .3);
  color: var(--accent);
}
.ticon svg { width: 24px; height: 24px; }

/* ===== ترويسة صفحات الأدوات ===== */
.page-hero { text-align: center; padding: 26px 8px 4px; }
.page-hero .ticon { width: 60px; height: 60px; border-radius: 18px; margin: 0 auto 4px; }
.page-hero .ticon svg { width: 30px; height: 30px; }
.page-hero h1 { font-size: clamp(1.4rem, 4.5vw, 1.9rem); font-weight: 800; margin: 10px 0 2px; }
.page-hero .sub { color: var(--muted); margin-top: 0; }

/* ===== لوحة الأداة ===== */
.panel {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 22px;
  margin-top: 20px;
  backdrop-filter: blur(6px);
}
label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: .95rem; }
input[type="text"], input[type="number"], input[type="date"], textarea, select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  font: inherit;
  background: rgba(255, 255, 255, .06);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 59, 92, .18);
}
input::placeholder, textarea::placeholder { color: rgba(168, 156, 171, .6); }
textarea { min-height: 160px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-row { display: flex; gap: 16px; margin: 12px 0; flex-wrap: wrap; }
.radio-row label { font-weight: 400; margin: 0; display: inline-flex; align-items: center; gap: 6px; }
input[type="radio"] { accent-color: var(--accent); width: 17px; height: 17px; }
button {
  margin-top: 16px;
  background: linear-gradient(120deg, var(--accent), #c81e3a);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 13px 34px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 59, 92, .3);
  transition: transform .15s, filter .15s;
}
button:hover { transform: translateY(-2px); filter: brightness(1.08); }
button:active { transform: translateY(0); }
.result {
  margin-top: 18px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 59, 92, .45);
  border-radius: 14px;
  padding: 15px;
  font-weight: 700;
  font-size: 1.02rem;
  box-shadow: 0 0 24px rgba(255, 59, 92, .12);
}
.result.pop { animation: pop .35s ease; }
@keyframes pop {
  0% { transform: scale(.96); opacity: .4; }
  100% { transform: scale(1); opacity: 1; }
}
.note { color: var(--muted); font-size: .83rem; margin-top: 18px; }
.note a { color: var(--accent-2); }
.howto { margin-top: 30px; }
.howto h2 { font-size: 1.15rem; }
.howto p, .howto li { color: var(--muted); }
footer {
  border-top: 1px solid var(--line);
  padding: 20px;
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
}

@media (max-width: 640px) {
  .orb { display: none; }
}

/* ===== ظهور تدريجي ===== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* الشعار الرسمي */
.logo-img { width: 34px; height: 34px; border-radius: 50%; display: inline-block; }

/* الجواب السريع وSEO */
.answer-first { background: rgba(255,59,92,.07); border: 1px solid rgba(255,59,92,.25); border-radius: 12px; padding: 14px 16px; font-size: .98rem; line-height: 1.9; margin: 0 auto 18px; max-width: 640px; }
.faq { max-width: 640px; margin: 26px auto 0; text-align: start; }
.faq h2 { font-size: 1.15rem; margin-bottom: 12px; }
.faq details { background: var(--card, rgba(255,255,255,.03)); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin-top: 10px; color: var(--muted); line-height: 1.9; font-size: .95rem; }
.store-cta { text-align: center; margin: 40px auto 0; max-width: 640px; padding: 28px 20px; border-radius: 16px; background: linear-gradient(135deg, rgba(255,59,92,.10), rgba(122,59,255,.10)); border: 1px solid rgba(255,59,92,.25); }
.store-cta h2 { margin-bottom: 8px; }
.store-cta p { color: var(--muted); margin-bottom: 16px; }
.store-btn { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; padding: 12px 30px; border-radius: 12px; }
.fnav { margin-top: 8px; }
.fnav a { color: var(--muted); }

/* شريط منظومة نبض */
.eco-strip { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,.06); background: rgba(12,10,18,.6); }
.eco-strip img { border-radius: 50%; }
.eco-strip a { color: var(--accent-2); text-decoration: none; font-weight: 600; }
.eco-strip a:hover { text-decoration: underline; }
.eco-strip .dot { opacity: .5; }
.eco-strip.foot { border-bottom: 0; border-top: 1px solid rgba(255,255,255,.06); background: none; margin-bottom: 8px; }
header nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }

/* Mobile: single-line scrollable ecosystem strip, no stray dots */
@media (max-width: 640px) {
  .eco-strip { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; white-space: nowrap; font-size: .78rem; padding: 8px 12px; gap: 6px; scrollbar-width: none; }
  .eco-strip::-webkit-scrollbar { display: none; }
  .eco-strip > span:first-of-type { display: none; }
  .eco-strip img { flex: 0 0 auto; }
}
