:root{
  --bg:#0b0c0e; --surface:#121418; --surface2:#181b21; --border:#23272f; --border2:#2e333c;
  --text:#e6e8eb; --muted:#9aa1ad; --accent:#4aa3df; --accent-ink:#06121b;
  --green:#3fb97a; --yellow:#d9a441; --red:#d6604d; --gray:#6b7280;
  --radius:14px; --maxw:1080px;
  --font:system-ui,-apple-system,"Segoe UI","Noto Sans Arabic","Noto Naskh Arabic",Tahoma,sans-serif;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);line-height:1.75;font-size:16px;min-height:100vh;display:flex;flex-direction:column}
body.locked{overflow:hidden}
a{color:var(--accent);text-decoration:none}
a:hover{text-decoration:underline}
h1,h2,h3{line-height:1.35;margin:0 0 .5em}
p{margin:0 0 1em}
img{max-width:100%;height:auto;display:block}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}
[hidden]{display:none!important}
#view{flex:1;width:100%;max-width:var(--maxw);margin:0 auto;padding:24px 16px 48px;outline:none}
.footer{border-top:1px solid var(--border);padding:18px 16px;text-align:center;color:var(--muted);font-size:.85rem}
.noscript{padding:16px;text-align:center}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* topbar */
.topbar{position:sticky;top:0;z-index:30;display:flex;align-items:center;justify-content:space-between;
  height:58px;padding:0 14px;background:rgba(11,12,14,.92);border-bottom:1px solid var(--border);backdrop-filter:blur(6px)}
.brand{display:flex;align-items:center;gap:10px;color:var(--text);font-weight:700;letter-spacing:.12em}
.brand:hover{text-decoration:none}
.icon-btn{width:42px;height:42px;display:inline-grid;place-items:center;background:var(--surface);color:var(--text);
  border:1px solid var(--border);border-radius:12px;cursor:pointer}
.icon-btn:hover{background:var(--surface2);border-color:var(--border2)}
.icon-btn svg{width:22px;height:22px}

/* drawer */
.scrim{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:40;opacity:0;transition:opacity .22s}
.scrim.show{opacity:1}
.drawer{position:fixed;top:0;bottom:0;right:0;width:min(320px,86vw);background:var(--surface);border-left:1px solid var(--border);
  z-index:50;transform:translateX(100%);transition:transform .25s ease;display:flex;flex-direction:column;visibility:hidden}
.drawer.open{transform:none;visibility:visible}
.drawer-head{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid var(--border)}
.drawer ul{list-style:none;margin:0;padding:10px;overflow:auto}
.drawer li a{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:12px;color:var(--text);margin-bottom:4px}
.drawer li a:hover{background:var(--surface2);text-decoration:none}
.drawer li a[aria-current="page"]{background:rgba(74,163,223,.12);color:var(--accent)}
.drawer li svg{width:20px;height:20px;flex:none}

/* splash */
.splash{position:fixed;inset:0;z-index:100;background:var(--bg);display:grid;place-items:center;text-align:center;transition:opacity .4s}
.splash.out{opacity:0}
.splash-inner{display:flex;flex-direction:column;align-items:center;gap:6px;padding:20px}
.splash-logo{color:var(--accent);animation:rise .7s ease both}
.splash-title{font-size:1.7rem;letter-spacing:.22em;margin:10px 0 0;animation:rise .7s .12s ease both}
.splash-text{color:var(--muted);margin:0 0 14px;animation:rise .7s .24s ease both}
.splash-bar{width:180px;height:3px;background:var(--border);border-radius:3px;overflow:hidden}
.splash-bar span{display:block;height:100%;width:100%;background:var(--accent);transform-origin:right;animation:fill var(--splash-ms,3000ms) linear forwards}
@keyframes rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes fill{from{transform:scaleX(0)}to{transform:scaleX(1)}}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}
