:root{
  --bg:#070B14;
  --bg2:#0B1220;

  --text:#EAF0FF;
  --muted:rgba(234,240,255,.72);
  --muted2:rgba(234,240,255,.55);

  --brand:#6EE7FF;
  --brand2:#B794F6;

  --shadow: 0 20px 80px rgba(0,0,0,.45);
  --radius: 20px;

  color-scheme: dark;
}

/* Light theme overrides */
html.theme-light{
  color-scheme: light;
  --bg:#F6F8FF;
  --bg2:#EEF2FF;

  --text:#0B1220;
  --muted:rgba(11,18,32,.72);
  --muted2:rgba(11,18,32,.55);

  --shadow: 0 20px 80px rgba(0,0,0,.12);
}

*{box-sizing:border-box}
html,body{height:100%}

/* ✅ prevent right-side vertical bar (horizontal overflow) */
html, body{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
  background:#070B14;
}

body{
  margin:0;
  font-family:"Tajawal",system-ui,-apple-system,Segoe UI,Roboto,Arial;
  color:var(--text);
  background: linear-gradient(180deg, var(--bg), var(--bg2));
  position:relative;
}

body::before{
  content:"";
  position:fixed;
  inset:-40px;
  z-index:-1;
  pointer-events:none;

  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(110,231,255,.18), transparent 55%),
    radial-gradient(1000px 700px at 80% 30%, rgba(183,148,246,.14), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg2));

  transform: translateZ(0);
  will-change: transform;
}

a{color:inherit; text-decoration:none}
img{max-width:100%; display:block}

.container{
  width:100%;
  max-width:1100px;
  margin-inline:auto;
  padding-inline:16px;
}

/* ================= Header ================= */
.topbar{
  position:sticky; top:0; z-index:50;
  left:0; right:0; width:100%;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  background: rgba(7,11,20,.55);
  border-bottom:1px solid rgba(255,255,255,.08);
}

/* Light header */
html.theme-light .topbar{
  background: rgba(255,255,255,.78);
  border-bottom: 1px solid rgba(11,18,32,.10);
}

.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 0;
}

.topbar__actions{
  display:flex;
  align-items:center;
  gap:10px;
}

/* Brand */
.brand{display:flex; gap:12px; align-items:center; min-width:0}
.brand__mark{
  width:36px; height:36px; border-radius:12px;
  background: linear-gradient(135deg, rgba(110,231,255,.95), rgba(183,148,246,.95));
  box-shadow: 0 12px 40px rgba(110,231,255,.18);
  flex:0 0 auto;
}
.brand__text{display:flex; flex-direction:column; gap:2px; min-width:0}
.brand__name{font-weight:800; letter-spacing:.2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.brand__tag{font-size:.9rem; color:var(--muted2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}

/* Nav */
.nav{display:flex; gap:18px; align-items:center}
.nav__link{
  padding:10px 12px;
  border-radius:12px;
  color:var(--muted);
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.nav__link:hover{transform:translateY(-1px); background:rgba(255,255,255,.06); color:var(--text)}
.nav__link.is-active{background:rgba(110,231,255,.12); color:var(--text); border:1px solid rgba(110,231,255,.22)}

html.theme-light .nav__link{color: rgba(11,18,32,.72)}
html.theme-light .nav__link:hover{background: rgba(11,18,32,.06); color:#0B1220}
html.theme-light .nav__link.is-active{background: rgba(110,231,255,.22); border-color: rgba(110,231,255,.35)}

/* Theme button */
.themeToggle{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor:pointer;
  user-select:none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.themeToggle:hover{ transform: translateY(-1px); background: rgba(255,255,255,.08); }
.themeDot{
  width:10px; height:10px;
  border-radius:999px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
}
html.theme-light .themeToggle{
  background: rgba(11,18,32,.05);
  border-color: rgba(11,18,32,.12);
  color: #0B1220;
}

/* Burger */
.burger{
  display:none;
  width:44px; height:44px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.05);
  cursor:pointer;
}
.burger span{display:block; height:2px; margin:7px 10px; background:rgba(234,240,255,.82); border-radius:99px}
html.theme-light .burger span{background: rgba(11,18,32,.70)}
html.theme-light .burger{background: rgba(11,18,32,.05); border-color: rgba(11,18,32,.12)}

/* Mobile menu */
.mobileNav{
  display:none;
  border-top:1px solid rgba(255,255,255,.08);
  background: rgba(7,11,20,.72);
}
.mobileNav__inner{padding:14px 0; display:grid; gap:10px}
.mobileNav__link{
  padding:12px 14px; border-radius:14px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
  color:var(--muted);
}
.mobileNav__link.is-active{background:rgba(110,231,255,.12); color:var(--text); border-color:rgba(110,231,255,.22)}
.mobileNav__meta{display:flex; gap:10px; flex-wrap:wrap; margin-top:6px}

html.theme-light .mobileNav{
  background: rgba(255,255,255,.92);
  border-top: 1px solid rgba(11,18,32,.10);
}
html.theme-light .mobileNav__link{
  background: rgba(11,18,32,.05);
  border-color: rgba(11,18,32,.12);
  color: rgba(11,18,32,.75);
}

/* ================= Main sections ================= */
.main{min-height: calc(100vh - 220px);}

.hero{position:relative; padding:58px 0 24px}
.hero__grid{display:grid; grid-template-columns: 1.1fr .9fr; gap:26px; align-items:center}
.hero__h{font-size: clamp(28px, 3.2vw, 46px); line-height:1.1; margin:10px 0 12px}
.hero__p{color:var(--muted); font-size:1.05rem; line-height:1.9; margin:0 0 16px}
.grad{
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.pill{
  display:inline-flex; gap:8px; align-items:center;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.05);
  color:var(--muted);
}
html.theme-light .pill{
  background: rgba(11,18,32,.05);
  border-color: rgba(11,18,32,.12);
  color: rgba(11,18,32,.72);
}

.hero__actions{display:flex; gap:12px; flex-wrap:wrap; margin:10px 0 14px}

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:12px 16px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color:var(--text);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.btn:hover{transform:translateY(-1px); background:rgba(255,255,255,.08)}
.btn--primary{
  border-color:rgba(110,231,255,.25);
  background: linear-gradient(135deg, rgba(110,231,255,.18), rgba(183,148,246,.14));
}
.btn--ghost{background:transparent}
.btn--ios{border-color:rgba(110,231,255,.28)}
.btn--android{border-color:rgba(124,255,178,.22)}
html.theme-light .btn{
  background: rgba(11,18,32,.05);
  border-color: rgba(11,18,32,.12);
  color:#0B1220;
}

.stats{display:flex; gap:12px; flex-wrap:wrap}
.stat{
  min-width:140px;
  padding:12px 14px;
  border-radius:16px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
}
.stat__n{font-weight:800; font-size:1.25rem}
.stat__t{color:var(--muted2); margin-top:2px}

.hero__card{position:relative}
.glassCard{
  padding:18px;
  border-radius: var(--radius);
  background: rgba(11,18,32,.58);
  border:1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow);
  overflow:hidden;
  isolation:isolate;
}
html.theme-light .glassCard{
  background: rgba(255,255,255,.86);
  border-color: rgba(11,18,32,.12);
}

.glassCard__top{display:flex; gap:12px; align-items:center}
.avatar{
  width:44px; height:44px; border-radius:16px;
  background: linear-gradient(135deg, rgba(110,231,255,.22), rgba(183,148,246,.22));
  border:1px solid rgba(255,255,255,.10);
}
.glassCard__name{font-weight:800}
.glassCard__role{color:var(--muted2); font-size:.95rem}
.glassCard__mid{margin:14px 0 12px}
.miniGrid{display:grid; gap:10px}
.miniApp{
  display:flex; gap:10px; align-items:center;
  padding:10px 12px; border-radius:16px;
  background:rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.10);
}
html.theme-light .miniApp{
  background: rgba(11,18,32,.04);
  border-color: rgba(11,18,32,.10);
}

.miniApp__icon{
  width:40px; height:40px; border-radius:14px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
}
.miniApp__icon span{font-weight:800; color:var(--muted)}
.miniApp__txt{display:flex; flex-direction:column; gap:2px}
.miniApp__n{font-weight:700}
.miniApp__s{color:var(--muted2); font-size:.92rem}
.glassCard__bottom{display:flex; gap:10px; flex-wrap:wrap}

.section{padding:36px 0}
.section--tight{padding:22px 0 36px}
.section__head{margin-bottom:18px}
.section__h{font-size: clamp(22px, 2.4vw, 32px); margin:0 0 8px}
.section__p{color:var(--muted); margin:0; line-height:1.9}

.cards{display:grid; grid-template-columns: repeat(3, 1fr); gap:14px}
.cards--2{grid-template-columns: repeat(2, 1fr)}
.card{
  padding:16px;
  border-radius: var(--radius);
  background: rgba(11,18,32,.58);
  border:1px solid rgba(255,255,255,.10);
  box-shadow: 0 14px 50px rgba(0,0,0,.25);
  overflow:hidden;
  isolation:isolate;
}
html.theme-light .card{
  background: rgba(255,255,255,.86);
  border-color: rgba(11,18,32,.12);
}

.card__icon{font-size:22px}
.card__h{font-weight:800; margin-top:10px}
.card__p{color:var(--muted); margin:8px 0 0; line-height:1.9}

/* Apps cards */
.appsGrid{display:grid; grid-template-columns: repeat(3, 1fr); gap:14px}
.appCard{
  padding:16px;
  border-radius: var(--radius);
  background: rgba(11,18,32,.62);
  border:1px solid rgba(255,255,255,.10);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
  overflow:hidden;
  isolation:isolate;
}
.appCard:hover{transform:translateY(-2px); border-color: rgba(110,231,255,.18); background: rgba(11,18,32,.72)}
html.theme-light .appCard{
  background: rgba(255,255,255,.86);
  border-color: rgba(11,18,32,.12);
}
html.theme-light .appCard:hover{
  background: rgba(255,255,255,.92);
  border-color: rgba(110,231,255,.35);
}

.appCard__top{display:flex; gap:12px; align-items:center}
.appIcon{
  width:52px; height:52px; border-radius:18px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
  flex:0 0 auto;
}
.appIcon span{font-weight:900; color:var(--muted)}
.appHead{display:flex; flex-direction:column; gap:2px; min-width:0}
.appName{font-weight:900}
.appSub{color:var(--muted2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.appDesc{color:var(--muted); line-height:1.9; margin:12px 0}

.badges{display:flex; gap:8px; flex-wrap:wrap; margin-top:6px; max-width:100%}
.badge{
  padding:7px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.18);
  color:var(--muted2);
  font-size:.9rem;
}
html.theme-light .badge{
  background: rgba(11,18,32,.04);
  border-color: rgba(11,18,32,.10);
  color: rgba(11,18,32,.72);
}

.appActions{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px}

/* Chips */
.chip{
  display:inline-flex; align-items:center; justify-content:center;
  padding:9px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.05);
  color:var(--muted);
}
html.theme-light .chip{
  background: rgba(11,18,32,.04);
  border-color: rgba(11,18,32,.10);
  color: rgba(11,18,32,.72);
}

/* Footer */
.footer{
  margin-top:26px;
  border-top:1px solid rgba(255,255,255,.10);
  background: rgba(7,11,20,.55);
}
html.theme-light .footer{
  background: rgba(255,255,255,.78);
  border-top:1px solid rgba(11,18,32,.10);
}
.footer__grid{
  padding:22px 0;
  display:grid; grid-template-columns: 1.2fr .7fr .9fr; gap:14px;
}
.footer__brand{display:flex; gap:12px; align-items:center}
.footer__title{font-weight:900}
.footer__sub{color:var(--muted2); margin-top:2px}
.footer__p{color:var(--muted); line-height:1.9; margin:10px 0 0}
.footer__h{font-weight:900; margin-bottom:10px}
.footer__link{display:block; color:var(--muted); margin:8px 0}
.footer__link:hover{color:var(--text)}
.footer__meta{display:grid; gap:8px; color:var(--muted)}
.footer__meta span{color:var(--muted2)}
.social{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px}
.social__a{
  padding:9px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: var(--muted);
}
html.theme-light .social__a{
  background: rgba(11,18,32,.04);
  border-color: rgba(11,18,32,.10);
  color: rgba(11,18,32,.72);
}

.footer__bottom{
  padding:14px 0 18px;
  color:var(--muted2);
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
}
.dot{opacity:.6}

/* Reveal */
[data-reveal]{opacity:0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease;}
[data-reveal].is-in{opacity:1; transform: translateY(0);}

/* Responsive */
@media (max-width: 980px){
  .hero__grid{grid-template-columns: 1fr; gap:16px}
  .appsGrid{grid-template-columns: repeat(2, 1fr)}
  .cards{grid-template-columns: 1fr}
  .cards--2{grid-template-columns: 1fr}
  .footer__grid{grid-template-columns: 1fr}
  .nav{display:none}
  .burger{display:inline-block}
  .mobileNav{display:block; max-height:0; overflow:hidden; transition:max-height .25s ease}
  .mobileNav.is-open{max-height:520px}

  /* safer on mobile: reduce blur artifacts */
  .topbar{
    -webkit-backdrop-filter:none;
    backdrop-filter:none;
    background: rgba(7,11,20,.92);
  }
  html.theme-light .topbar{ background: rgba(255,255,255,.92); }
}
@media (max-width: 560px){
  .appsGrid{grid-template-columns: 1fr}
  .btn{width:100%}
  .themeToggle__txt{display:none;} /* optional: icon-only on very small screens */
}
/* ===========================
   Theme (Light) overrides
   =========================== */
html.theme-light{
  color-scheme: light;

  --bg:#F6F8FF;
  --bg2:#EEF2FF;

  --text:#0B1220;
  --muted:rgba(11,18,32,.72);
  --muted2:rgba(11,18,32,.55);
}

/* Light header/cards/buttons */
html.theme-light .topbar{
  background: rgba(255,255,255,.80) !important;
  border-bottom: 1px solid rgba(11,18,32,.12) !important;
}
html.theme-light .mobileNav{
  background: rgba(255,255,255,.92) !important;
  border-top: 1px solid rgba(11,18,32,.12) !important;
}
html.theme-light .nav__link{ color: rgba(11,18,32,.75) !important; }
html.theme-light .btn,
html.theme-light .card,
html.theme-light .glassCard,
html.theme-light .appCard,
html.theme-light .stat,
html.theme-light .visitorsCard,
html.theme-light .vItem{
  background: rgba(255,255,255,.86) !important;
  border-color: rgba(11,18,32,.12) !important;
  color: #0B1220 !important;
}

/* Theme toggle button style */
.themeToggle{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor:pointer;
}
.themeDot{
  width:10px;height:10px;border-radius:999px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
}
html.theme-light .themeToggle{
  background: rgba(11,18,32,.06);
  border-color: rgba(11,18,32,.14);
  color:#0B1220;
}

/* ===========================
   Visitors Card (if you use it)
   =========================== */
.visitorsCard{
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 14px 50px rgba(0,0,0,.25);
}
.visitorsCard__head{
  display:flex; align-items:baseline; justify-content:space-between;
  gap:12px; margin-bottom:12px;
}
.visitorsCard__title{font-weight:900; font-size:1.05rem;}
.visitorsCard__sub{color:var(--muted2); font-size:.92rem;}
.visitorsGrid{display:grid; grid-template-columns: repeat(4, 1fr); gap:12px;}
.vItem{
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.10);
}
.vItem__k{color:var(--muted2); font-size:.9rem;}
.vItem__v{margin-top:6px; font-weight:900; font-size:1.35rem;}
@media (max-width: 980px){
  .visitorsGrid{ grid-template-columns: repeat(2, 1fr); }
}
/* ===========================
   FIX: Light theme not visible
   Paste at END of app.css
   =========================== */

/* 1) اجبار خلفية الصفحة تتبدل فعلياً */
html.theme-light,
html.theme-light body{
  background: linear-gradient(180deg, var(--bg), var(--bg2)) !important;
  background-color: var(--bg) !important;
  color: var(--text) !important;
}

/* 2) لو عندك طبقة خلفية (body::before) خليها تستخدم الوان فاتحة */
html.theme-light body::before{
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(110,231,255,.14), transparent 55%),
    radial-gradient(1000px 700px at 80% 30%, rgba(183,148,246,.10), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg2)) !important;
}

/* 3) اجبار الهيدر والقائمة المنسدلة والكروت تكون واضحة بالفاتح */
html.theme-light .topbar{
  background: rgba(255,255,255,.86) !important;
  border-bottom: 1px solid rgba(11,18,32,.12) !important;
}
html.theme-light .mobileNav{
  background: rgba(255,255,255,.94) !important;
  border-top: 1px solid rgba(11,18,32,.12) !important;
}

html.theme-light .card,
html.theme-light .glassCard,
html.theme-light .appCard,
html.theme-light .appPage,
html.theme-light .stat,
html.theme-light .visitorsCard,
html.theme-light .vItem{
  background: rgba(255,255,255,.88) !important;
  border-color: rgba(11,18,32,.12) !important;
  color: #0B1220 !important;
}

html.theme-light .nav__link,
html.theme-light .footer__link,
html.theme-light .appDesc,
html.theme-light .section__p,
html.theme-light .card__p{
  color: rgba(11,18,32,.72) !important;
}

html.theme-light{
  --bg:#F6F8FF;
  --bg2:#EEF2FF;
  --text:#0B1220;
  --muted:rgba(11,18,32,.72);
  --muted2:rgba(11,18,32,.55);
  color-scheme: light;
}