:root{
      --bg:#000;
      --panel: rgba(255,255,255,.04);
      --panel2: rgba(255,255,255,.06);
      --border: rgba(255,255,255,.10);
      --txt:#fff;
      --muted: rgba(255,255,255,.72);
      --muted2: rgba(255,255,255,.55);
      --red:#e40000;
      --red2:#c00000;
      --red3:#850000;
      --shadow: 0 30px 90px -50px rgba(228,0,0,.35);
      --radius: 22px;
      --radius2: 30px;
      --max: 1120px;
    }

    *{box-sizing:border-box}
    html{scroll-behavior:smooth}
    body{
      margin:0;
      font-family: "Cairo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
      background: var(--bg);
      color: var(--txt);
      overflow-x:hidden;
    }

    /* خطوط الموقع: Cairo للنصوص + Changa للعناوين والأزرار */
    h1,h2,h3,h4,h5,h6,
    .h1,.h2,
    .btn,
    .navlinks a,
    .badge,
    .brand .t1{
      font-family: "Changa", "Cairo", sans-serif;
      letter-spacing: 0;
    }

    a{color:inherit; text-decoration:none}
    .container{max-width:var(--max); margin:0 auto; padding:0 18px}

    /* --------- Animated background layers --------- */
    .bg-wrap{position:relative; min-height:100vh; overflow-x:hidden}

    /* subtle dot grid */
    .dotgrid{
      position:fixed; inset:0; opacity:.10; pointer-events:none;
      background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.35) 1px, transparent 0);
      background-size: 24px 24px;
      mask-image: radial-gradient(circle at 50% 30%, black 0 55%, transparent 72%);
      -webkit-mask-image: radial-gradient(circle at 50% 30%, black 0 55%, transparent 72%);
    }

    /* animated blobs */
    .blob{
      position: fixed;
      width: 520px; height: 520px;
      border-radius: 999px;
      filter: blur(60px);
      opacity: .26;
      pointer-events:none;
      mix-blend-mode: screen;
      animation: floaty 12s ease-in-out infinite;
      transform: translate3d(0,0,0);
    }
    .blob.b1{ left:-160px; top:-140px; background: radial-gradient(circle at 30% 30%, rgba(228,0,0,.85), rgba(133,0,0,.35), transparent 70%); }
    .blob.b2{ right:-190px; top:160px; width: 620px; height: 620px; opacity:.22; animation-duration: 15s; background: radial-gradient(circle at 35% 35%, rgba(192,0,0,.75), rgba(133,0,0,.35), transparent 70%); }
    .blob.b3{ left:40%; bottom:-260px; width: 720px; height: 720px; opacity:.18; animation-duration: 18s; background: radial-gradient(circle at 40% 40%, rgba(228,0,0,.65), rgba(133,0,0,.30), transparent 72%); }

    @keyframes floaty{
      0%   { transform: translate3d(0,0,0) scale(1) }
      30%  { transform: translate3d(60px, -30px, 0) scale(1.05) }
      60%  { transform: translate3d(-40px, 50px, 0) scale(0.98) }
      100% { transform: translate3d(0,0,0) scale(1) }
    }

    /* moving scan lines */
    .scanlines{
      position:fixed; inset:0;
      pointer-events:none;
      opacity:.07;
      background: repeating-linear-gradient(
        to bottom,
        rgba(255,255,255,.10) 0px,
        rgba(255,255,255,.10) 1px,
        transparent 2px,
        transparent 6px
      );
      animation: scan 7s linear infinite;
      mask-image: radial-gradient(circle at 50% 25%, black 0 55%, transparent 78%);
      -webkit-mask-image: radial-gradient(circle at 50% 25%, black 0 55%, transparent 78%);
    }
    @keyframes scan{
      from{ transform: translateY(0) }
      to{ transform: translateY(120px) }
    }

    /* particles canvas */
    canvas#particles{
      position:fixed; inset:0;
      width:100%; height:100%;
      pointer-events:none;
      opacity:.55;
    }

    /* header */
    header{
      position: relative;
      top: auto;
      z-index: 50;
      border-bottom:1px solid rgba(255,255,255,.06);
      background: rgba(0,0,0,.70);
      backdrop-filter: blur(16px);
    }
    .nav{
      display:flex; align-items:center; justify-content:space-between;
      height:68px; gap:14px;
    }
    .brand{display:flex; align-items:center; gap:12px}

    /* Logo (PNG ثابت) */
    .logo{
      width: 125px;
      height: 63px;
      border-radius: 0;
      display:flex;
      align-items:center;
      justify-content:center;
      background: transparent;
      border: none;
      box-shadow: none;
      padding: 0;
    }
    .logo img.logo-img{
      width: 100%;
      height: 100%;
      object-fit: contain;
      display:block;
      border-radius: 0;
      filter: none;
    }
    @media (max-width: 980px){
      .logo{ width: 100px; height: 50px; }
    }

    .brand .t1{font-weight:900; font-size:14px; line-height:1}
    .brand .t2{font-size:12px; color: rgba(255,255,255,.55); margin-top:4px}

    .navlinks{display:flex; align-items:center; gap:18px; color: rgba(255,255,255,.75); font-size:14px}
    .navlinks a{padding:10px 8px; border-radius:12px}
    .navlinks a:hover{color:#fff; background: rgba(255,255,255,.06)}
    .nav-actions{display:flex; align-items:center; gap:10px}

    .btn{
      border:1px solid rgba(255,255,255,.10);
      background: rgba(255,255,255,.06);
      color:#fff;
      padding:11px 14px;
      border-radius:16px;
      display:inline-flex; align-items:center; gap:10px;
      font-weight:800; font-size:13px;
      cursor:pointer;
      transition: transform .15s ease, background .2s ease, border-color .2s ease;
      user-select:none;
    }
    .btn:hover{background: rgba(255,255,255,.10)}
    .btn:active{transform: translateY(1px)}
    .btn-primary{
      border-color: rgba(228,0,0,.25);
      background: linear-gradient(180deg, rgba(228,0,0,.98), rgba(133,0,0,.98));
      box-shadow: 0 18px 60px -22px rgba(228,0,0,.55);
    }
    .btn-primary:hover{
      background: linear-gradient(180deg, rgba(228,0,0,1), rgba(133,0,0,.98));
    }
    .btn-ghost{
      border-color: rgba(228,0,0,.20);
      background: rgba(228,0,0,.10);
      color: rgba(255,255,255,.92);
    }
    .btn-ghost:hover{background: rgba(228,0,0,.18)}
    .icon{width:18px; height:18px; display:inline-block}

    /* sections */
    section{padding: 56px 0}
    .badge{
      display:inline-flex; align-items:center; gap:8px;
      padding:8px 12px; border-radius:999px;
      border:1px solid rgba(228,0,0,.22);
      background: rgba(228,0,0,.10);
      color: rgba(255,255,255,.92);
      font-size:13px;
      backdrop-filter: blur(8px);
    }
    .dot{
      width:8px; height:8px; border-radius:999px; background: var(--red);
      box-shadow: 0 0 0 0 rgba(228,0,0,.35);
      animation: livePulse 1.25s ease-in-out infinite;
    }
    @keyframes livePulse{
      0%{ box-shadow: 0 0 0 0 rgba(228,0,0,.35); transform: scale(1); opacity: 1; }
      55%{ box-shadow: 0 0 0 10px rgba(228,0,0,0); transform: scale(1.08); opacity: .95; }
      100%{ box-shadow: 0 0 0 0 rgba(228,0,0,0); transform: scale(1); opacity: 1; }
    }
    .h2{font-size: 30px; margin:14px 0 0; font-weight:1000; letter-spacing:-.4px}
    .sub{margin:10px 0 0; max-width: 740px; line-height:1.8; color: rgba(255,255,255,.72)}

    /* hero */
    .hero{padding-top: 44px}
    .hero-grid{
      display:grid; gap:22px;
      grid-template-columns: 1.2fr .8fr;
      align-items:start;
    }
    @media (max-width: 980px){
      .navlinks{display:none}
      .hero-grid{grid-template-columns:1fr}
    }
    .h1{
      margin:16px 0 0;
      font-size: 48px;
      line-height:1.08;
      font-weight: 1100;
      letter-spacing:-.9px;
    }
    @media (max-width: 560px){ .h1{font-size: 38px} }

    /* Responsive typography */
    .h1{ font-size: clamp(34px, 4.2vw, 48px); }
    .h2{ font-size: clamp(22px, 2.8vw, 30px); }
    .lead{ font-size: clamp(14px, 1.6vw, 16px); }
    @media (max-width: 520px){
      .btn{ padding: 10px 12px; border-radius: 14px; }
      .social a{ width:38px; height:38px; border-radius:16px; }
      section{ padding: 44px 0; }
      footer{ padding: 16px 0 20px; }
    }

    .accent{color: rgba(228,0,0,.98)}
    .lead{
      margin:14px 0 0;
      font-size: 16px;
      line-height: 1.9;
      color: rgba(255,255,255,.72);
      max-width: 760px;
    }
    .cta{margin-top:22px; display:flex; flex-wrap:wrap; gap:10px; align-items:center}

    .social{
      display:flex; gap:10px; margin-inline-start: 6px;
    }
    .social a{
      width:42px; height:42px;
      border-radius: 18px;
      display:grid; place-items:center;
      background: rgba(255,255,255,.06);
      border:1px solid rgba(255,255,255,.10);
      transition: background .2s ease, transform .15s ease, border-color .2s ease;
    }
    .social a:hover{background: rgba(255,255,255,.10); border-color: rgba(228,0,0,.22)}
    .social a:active{transform: translateY(1px)}

    /* cards */
    .card{
      border-radius: var(--radius2);
      border:1px solid rgba(255,255,255,.10);
      background: rgba(255,255,255,.04);
      box-shadow: 0 26px 80px -65px rgba(0,0,0,.9);
      overflow:hidden;
    }
    .card.red{
      border-color: rgba(228,0,0,.18);
      background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
      box-shadow: var(--shadow);
      position:relative;
    }
    .card.red::before{
      content:"";
      position:absolute; inset:0;
      background:
        radial-gradient(circle at 30% 20%, rgba(228,0,0,.22), transparent 55%),
        radial-gradient(circle at 70% 80%, rgba(133,0,0,.20), transparent 55%);
      pointer-events:none;
    }
    .card .inner{position:relative; padding: 18px}
    .card .head{display:flex; justify-content:space-between; align-items:flex-start; gap:12px}
    .card .head .name{font-weight:1000}
    .card .head .role{font-size:13px; color: rgba(255,255,255,.70); margin-top:6px}

    .info{display:grid; gap:10px; margin-top:14px}
    .pill{
      display:flex; align-items:center; gap:10px;
      padding: 12px 14px;
      border-radius: 18px;
      background: rgba(0,0,0,.30);
      border:1px solid rgba(255,255,255,.10);
    }
    .pill .i{width:18px; height:18px; color: rgba(228,0,0,.90)}
    .pill span{font-size: 13px; color: rgba(255,255,255,.85)}

    .divider{
      height:1px; width:100%;
      margin: 18px 0;
      background: linear-gradient(to left, transparent, rgba(228,0,0,.20), transparent);
    }

    .skill{
      padding: 14px;
      border-radius: 18px;
      background: rgba(0,0,0,.30);
      border:1px solid rgba(255,255,255,.10);
    }
    .skill-top{display:flex; justify-content:space-between; align-items:center}
    .skill-top strong{font-size:13px}
    .skill-top em{font-style:normal; font-size:12px; color: rgba(255,255,255,.55)}
    .bar{
      margin-top:10px;
      width:100%; height:10px;
      border-radius:999px;
      background: rgba(255,255,255,.06);
      overflow:hidden;
    }
    .bar > div{
      height:100%;
      border-radius:999px;
      background: linear-gradient(90deg, rgba(228,0,0,.98), rgba(133,0,0,.98));
      width: 0%;
      transition: width 0.0s;
    }

    /* stats */
    .stats{
      margin-top: 24px;
      display:grid;
      gap:10px;
      grid-template-columns: repeat(3, 1fr);
    }
    @media (max-width: 680px){ .stats{grid-template-columns:1fr} }
    .stat{
      border-radius: 22px;
      border:1px solid rgba(255,255,255,.10);
      background: rgba(255,255,255,.04);
      padding:14px;
      transition: transform .15s ease, border-color .2s ease;
    }
    .stat:hover{transform: translateY(-1px); border-color: rgba(228,0,0,.20)}
    .stat .k{font-size:12px; color: rgba(255,255,255,.55)}
    .stat .v{margin-top:8px; font-size:24px; font-weight:1000}

    .stat .mini{margin-top:10px; height:6px; border-radius:999px; background: rgba(255,255,255,.06); overflow:hidden}
    .stat .mini > div{height:100%; width:0%; background: linear-gradient(90deg, rgba(228,0,0,.98), rgba(133,0,0,.98))}

    /* tags */
    .tags{display:flex; flex-wrap:wrap; gap:8px}
    .tag{
      border-radius:999px;
      border:1px solid rgba(228,0,0,.20);
      background: rgba(228,0,0,.10);
      padding:7px 10px;
      font-size:12px;
      color: rgba(255,255,255,.88);
    }

    /* projects */
    .proj-top{display:flex; align-items:flex-end; justify-content:space-between; gap:12px; flex-wrap:wrap}
    .search{
      width:min(360px, 100%);
      border-radius: 18px;
      border:1px solid rgba(255,255,255,.10);
      background: rgba(255,255,255,.06);
      color:#fff;
      padding:12px 14px;
      outline:none;
    }
    .search::placeholder{color: rgba(255,255,255,.40)}
    .projects{margin-top: 16px; display:grid; gap:14px; grid-template-columns: repeat(3, 1fr)}
    /* Tablets: 2 columns. Phones: 1 column. */
    @media (max-width: 980px){ .projects{grid-template-columns: repeat(2, 1fr)} }
    @media (max-width: 640px){ .projects{grid-template-columns: 1fr} }
    .project{
      border-radius: var(--radius2);
      border:1px solid rgba(255,255,255,.10);
      background: rgba(255,255,255,.04);
      overflow:hidden;
      transition: transform .15s ease, border-color .2s ease, background .2s ease;
    }
    .project:hover{
      transform: translateY(-3px);
      border-color: rgba(228,0,0,.24);
      background: rgba(255,255,255,.05);
    }
    .proj-banner{
      width:100%;
      aspect-ratio: 550 / 300;
      background:
        radial-gradient(circle at 30% 20%, rgba(228,0,0,.34), transparent 62%),
        radial-gradient(circle at 70% 80%, rgba(133,0,0,.34), transparent 62%);
      position:relative;
    }

    .proj-banner{
      overflow:hidden;
    }
    
    @media (max-width: 992px){
      .proj-banner{ aspect-ratio: 450 / 245; }
    }
.proj-banner-img{
      position:absolute;
      inset:0;
      width:100%;
      height:100%;
      object-fit:cover;
      object-position:center;
      transform: scale(1.03);
      display:block;
    }
    .proj-banner.has-img::before{
      content:"";
      position:absolute;
      inset:0;
      background: linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.55));
      pointer-events:none;
    }
    .proj-banner.has-img .proj-badge{ z-index: 2; }

    .proj-badge{
      position:absolute; bottom:14px; right:14px;
      background: rgba(0,0,0,.45);
      border:1px solid rgba(228,0,0,.25);
      padding:7px 10px;
      border-radius:999px;
      font-size:12px;
    }
    .proj-body{padding:18px}
    .proj-body h3{margin:0; font-size:16px; font-weight:1000}
    .proj-body p{margin:8px 0 0; color: rgba(255,255,255,.70); line-height:1.8; font-size:13px}
    .chips{margin-top:12px; display:flex; flex-wrap:wrap; gap:8px}
    .chip{
      border-radius:999px;
      border:1px solid rgba(255,255,255,.10);
      background: rgba(255,255,255,.06);
      padding:7px 10px;
      font-size:12px;
      color: rgba(255,255,255,.82);
    }
    .proj-foot{margin-top:14px; display:flex; align-items:center; justify-content:space-between; gap:10px}
    .small{font-size:12px; color: rgba(255,255,255,.45)}

    /* contact */
    .contact-grid{display:grid; gap:14px; grid-template-columns: .9fr 1.1fr}
    @media (max-width: 980px){ .contact-grid{grid-template-columns:1fr} }
    .channel{
      display:flex; align-items:center; justify-content:space-between; gap:10px;
      padding:14px;
      border-radius: 18px;
      background: rgba(0,0,0,.30);
      border:1px solid rgba(255,255,255,.10);
    }
    .left{display:flex; align-items:center; gap:10px}
    .bubble{
      width:46px; height:46px; border-radius:18px;
      display:grid; place-items:center;
      background: linear-gradient(135deg, rgba(228,0,0,.22), rgba(133,0,0,.18));
      border:1px solid rgba(228,0,0,.22);
    }
    .channel .label{font-weight:1000; font-size:13px}
    .channel .value{font-size:12px; color: rgba(255,255,255,.55); margin-top:4px}

    form{display:grid; gap:10px}
    .row{display:grid; gap:10px; grid-template-columns: 1fr 1fr}
    @media (max-width: 560px){ .row{grid-template-columns:1fr} }
    input, textarea{
      border-radius: 18px;
      border:1px solid rgba(255,255,255,.10);
      background: rgba(0,0,0,.30);
      color:#fff;
      padding:12px 14px;
      outline:none;
      font-size:13px;
    }
    textarea{min-height: 150px; resize: vertical}
    input::placeholder, textarea::placeholder{color: rgba(255,255,255,.40)}
    input:focus, textarea:focus{border-color: rgba(228,0,0,.35); box-shadow: 0 0 0 4px rgba(228,0,0,.10)}

    #contact{ padding-bottom: 28px; }

    /* footer */
    footer{border-top:1px solid rgba(255,255,255,.06); padding: 18px 0 22px}
    .foot{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap}

    /* reveal */
    .reveal{opacity:1; transform:none;}

    /* Keep background animated but fixed (content scrolls normally) */
    .dotgrid, .scanlines, canvas#particles { position: fixed; inset: 0; }
    .blob { position: fixed; }

    /* ===== Mobile Menu (Sidebar) ===== */
    .menu-btn{ display:none; }

    @media (max-width: 980px){
      .menu-btn{ display:inline-flex; }
      .nav-actions{ gap:8px; flex-wrap:wrap; justify-content:flex-start; }
      .nav{ align-items:center; }
    }

    /* Backdrop */
    .backdrop{
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.55);
      backdrop-filter: blur(6px);
      opacity: 0;
      pointer-events: none;
      transition: opacity .22s ease;
      z-index: 80;
    }
    .backdrop.show{
      opacity: 1;
      pointer-events: auto;
    }

    /* Sidebar */
    .sidebar{
      position: fixed;
      top: 0;
      bottom: 0;
      right: 0; /* RTL: من اليمين */
      width: min(360px, 88vw);
      background: rgba(0,0,0,.82);
      border-left: 1px solid rgba(255,255,255,.08);
      backdrop-filter: blur(16px);
      transform: translateX(110%);
      transition: transform .24s ease;
      z-index: 90;
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 14px;
      }
    .sidebar.open{ transform: translateX(0); }

    .side-top{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap: 10px;
    }

    .side-links{
      display:flex;
      flex-direction:column;
      gap: 10px;
      margin-top: 6px;
    }

    .side-link{
      display:flex;
      align-items:center;
      justify-content:flex-start;
      padding: 12px 12px;
      border-radius: 16px;
      border: 1px solid rgba(255,255,255,.08);
      background: rgba(255,255,255,.05);
      color: rgba(255,255,255,.88);
      font-family: "Changa","Cairo",sans-serif;
    }
    .side-link:hover{
      border-color: rgba(228,0,0,.22);
      background: rgba(228,0,0,.10);
    }

    .side-actions{
      display:flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 6px;
    }
    .side-actions .btn{ flex: 1; justify-content:center; }

    /* Prevent sidebar on desktop */
    @media (min-width: 981px){
      .backdrop{ display:none; }
      .sidebar{ display:none; }
    }

    /* reduced motion */
    @media (prefers-reduced-motion: reduce){
      .blob, .scanlines{animation:none}
      .reveal{opacity:1; transform:none}
    }

    /* ===== Loader ===== */
    .loader{
      position: fixed;
      inset: 0;
      z-index: 9999;
      background: rgba(0,0,0,.92);
      backdrop-filter: blur(18px);
      display:flex;
      align-items:center;
      justify-content:center;
      padding: 18px;
      transition: opacity .35s ease, visibility .35s ease;
    }
    .loader.hide{
      opacity: 0;
      visibility: hidden;
      pointer-events:none;
    }
    .loader-card{
      width: min(520px, 92vw);
      border-radius: 28px;
      border: 1px solid rgba(255,255,255,.10);
      background: rgba(255,255,255,.05);
      box-shadow: 0 30px 90px -60px rgba(228,0,0,.55);
      padding: 18px;
    }
    .loader-top{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap: 12px;
    }
    .loader-brand{
      display:flex;
      align-items:center;
      gap: 12px;
      min-width: 0;
    }
    .loader-logo{
      width: 80px;
      height: 40px;
      display:flex;
      align-items:center;
      justify-content:center;
    }
    .loader-logo img{
      width:100%;
      height:100%;
      object-fit: contain;
      display:block;
    }
    .loader-title{
      font-family: "Changa","Cairo",sans-serif;
      font-weight: 800;
      font-size: 16px;
      white-space: nowrap;
      overflow:hidden;
      text-overflow: ellipsis;
    }
    .loader-sub{
      margin-top:6px;
      font-size: 12px;
      color: rgba(255,255,255,.60);
    }
    .loader-percent{
      font-family: "Changa","Cairo",sans-serif;
      font-weight: 900;
      font-size: 18px;
      color: rgba(255,255,255,.92);
    }
    .loader-bar{
      margin-top: 14px;
      height: 12px;
      border-radius: 999px;
      background: rgba(255,255,255,.06);
      overflow:hidden;
      border: 1px solid rgba(255,255,255,.08);
      position: relative;
    }
    .loader-fill{
      height:100%;
      width: 0%;
      border-radius: 999px;
      background: linear-gradient(90deg, rgba(228,0,0,.98), rgba(133,0,0,.98));
      position: relative;
    }
    .loader-fill::after{
      content:"";
      position:absolute;
      inset:-6px;
      background: radial-gradient(circle at 30% 50%, rgba(255,255,255,.35), transparent 55%);
      opacity:.25;
      filter: blur(4px);
      animation: shimmer 1.1s linear infinite;
    }
    @keyframes shimmer{
      from{ transform: translateX(-30%); }
      to{ transform: translateX(30%); }
    }
    .loader-hint{
      margin-top: 10px;
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap: 10px;
      font-size: 12px;
      color: rgba(255,255,255,.55);
    }
    .pulse-dot{
      width: 8px;
      height: 8px;
      border-radius: 999px;
      background: rgba(228,0,0,.95);
      box-shadow: 0 0 0 0 rgba(228,0,0,.35);
      animation: pulse 1.2s ease-in-out infinite;
    }
    @keyframes pulse{
      0%{ box-shadow: 0 0 0 0 rgba(228,0,0,.25); transform: scale(1); }
      50%{ box-shadow: 0 0 0 10px rgba(228,0,0,0); transform: scale(1.06); }
      100%{ box-shadow: 0 0 0 0 rgba(228,0,0,0); transform: scale(1); }
    }
  
/* Mr-X badge (fixed frame) */
.badge.badge-mrx{
  width: 75px;
  height: 45px;
  padding: 0;

  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;

  /* اجعل الإطار ظاهر */
  background: rgba(228,0,0,.08);          /* خلفية خفيفة */
  border: 1px solid rgba(228,0,0,.22);    /* إطار */
  border-radius: 16px;                    /* زوايا */
}

/* GIF inside the fixed frame */
.badge.badge-mrx .mrx-badge-gif{
  width: 80px;
  height: 45px;
  object-fit: contain;
  display:block;
  filter:none;
}
    @media (max-width: 520px){
      .badge.badge-mrx .mrx-badge-gif{ width: 54px; height: 27px; }
    }

    /* ===== Contact icons only ===== */
    .contact-icons-only{
      display:flex;
      gap: 14px;
      align-items:center;
      justify-content:center;
      padding: 18px 0 8px;
      flex-wrap: wrap;
    }
    .contact-icons-only .contact-icon{
      width: 56px;
      height: 56px;
      border-radius: 18px;
      display:flex;
      align-items:center;
      justify-content:center;
      border: 1px solid rgba(255,255,255,.10);
      background: rgba(255,255,255,.05);
      color: rgba(255,255,255,.95);
      transition: transform .15s ease, background .2s ease, border-color .2s ease;
    }
    .contact-icons-only .contact-icon:hover{
      transform: translateY(-2px);
      border-color: rgba(228,0,0,.35);
      background: rgba(228,0,0,.12);
    }
    .contact-icons-only .contact-icon svg{
      width: 26px;
      height: 26px;
    }
    @media (max-width: 520px){
      .contact-icons-only .contact-icon{ width: 52px; height: 52px; border-radius: 16px; }
      .contact-icons-only .contact-icon svg{ width: 24px; height: 24px; }
    }
    
    
    


@media (max-width: 980px){
  /* توسيط سطر البادج + سطر الأزرار */
  .hero .reveal{
    text-align: center;
  }

  /* البادج يبقى بحجمه الطبيعي ويتوسّط */
  .hero .badge{
    display: inline-flex;
    justify-content: center;
    margin: 0 auto;
  }

  /* توسيط العنوان والوصف */
  .hero .h1,
  .hero .lead{
    text-align: center;
  }

  /* توسيط الأزرار */
  .hero .cta{
    justify-content: center;
  }
}


/* ===== Mobile/iPad tweaks: hide Mr-X badge gif + center headings ===== */
@media (max-width: 980px){
  /* Hide animated badge next to بطاقة التعريف */
  .badge.badge-mrx{ display: none !important; }

  /* Center بطاقة التعريف title + role inside the ID card header */
  #skills .head{
    display:flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  #skills .head > div{
    width: 100%;
    text-align: center;
  }
  #skills .head .name,
  #skills .head .role{
    text-align: center;
    width: 100%;
  }
  #skills .head .role{
    margin-top: 8px;
  }

  /* Center projects section header (الأعمال + icon + title + subtitle) */
  #projects .proj-top{
    align-items: center;
  }
  #projects .proj-top > div{
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  #projects .proj-top .badge{
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }
  /* Search input stays nice on mobile */
  #projects .proj-top .search{
    width: min(520px, 100%);
  }
}


    #cvBtn{ min-width: 48px; }
    }


    /* Sidebar CV icon button matches outline */
    .cvBtnSide{
      background: transparent !important;
      border: 1px solid rgba(255,255,255,.85) !important;
      box-shadow: none !important;
      justify-content: center;
    }
    .cvBtnSide:hover{
      background: rgba(255,255,255,.06) !important;
      border-color: #fff !important;
    }


    /* ===== CV button (fixed frame, outline only) ===== */
    #cvBtn{
      /* visual */
      background: transparent !important;
      border: 1px solid rgba(255,255,255,.85) !important;
      box-shadow: none !important;
      color: #fff !important;

      /* fixed frame (never grows) */
      width: 54px;
      height: 44px;
      min-width: 54px !important;
      min-height: 44px !important;
      padding: 0 !important;

      display: inline-flex;
      align-items: center;
      justify-content: center;

      overflow: hidden; /* prevent any expansion/overflow */
    }
    #cvBtn:hover{
      background: rgba(255,255,255,.06) !important;
      border-color: #fff !important;
    }
    #cvBtn:active{ transform: translateY(1px); }

    /* Icon inside CV button (change ONLY these to resize the icon) */
    #cvBtn .cv-ico{
      width: 30px;   /* <-- change icon size here */
      height: 30px;  /* <-- change icon size here */
      object-fit: contain;
      display:block;
      filter: none;

      max-width: 100%;
      max-height: 100%;
    }

    /* Sidebar CV icon button matches outline (frame fixed by its own padding) */
    .cvBtnSide{
      background: transparent !important;
      border: 1px solid rgba(255,255,255,.85) !important;
      box-shadow: none !important;
      justify-content: center;
    }
    .cvBtnSide:hover{
      background: rgba(255,255,255,.06) !important;
      border-color: #fff !important;
    }

    @media (max-width: 520px){
      /* keep frame fixed on mobile too (optional smaller frame) */
      #cvBtn{
        width: 50px;
        height: 42px;
        min-width: 50px !important;
        min-height: 42px !important;
      }
      #cvBtn .cv-ico{
        width: 20px;  /* <-- mobile icon size */
        height: 20px;
      }
    }

/* Admin banner image support */
.proj-banner.has-img{background-size:cover;background-position:center;background-repeat:no-repeat;position:relative;}
.proj-banner.has-img::before{content:"";position:absolute;inset:0;background:linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.55));}
.proj-banner.has-img .proj-badge{position:absolute;z-index:1;}


/* ===== Footer social icons: white border + red icon ===== */
footer .social a{
  color: var(--red) !important;              /* icon color (SVG uses currentColor) */
  border-color: #ffffff !important;          /* white frame */
  background: transparent !important;        /* transparent inside frame */
}
footer .social a:hover{
  background: #ffffff !important;   /* أبيض */
  border-color: #ffffff !important;
  color: var(--red) !important;     /* يبقى لون الأيقونة أحمر */
}
/* Ensure SVG inherits the link color */
footer .social a svg{
  width: 24px;   /* جرّب 12px أو 14px أو 16px */
  height: 24px;
  fill: currentColor;
}


/* === Banner Slider (1080x480) === */
.banner-slider{ margin: 18px 0 26px; }
.banner-slider-box{
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 1080 / 480;
  width: 100%;
  /* Prevent the slider from becoming too tall on tablets */
  max-height: 360px;
}

.banner-slides{
  display: flex;
  width: 100%;
  height: 100%;
  direction: ltr;
  transform: translateX(0);
  transition: transform .6s ease;
  will-change: transform;
}

.banner-slide{
  min-width: 100%;
  display: block;
  text-decoration: none;
  height: 100%;
}

.banner-slide img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.banner-dots{
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

.banner-dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--panel2);
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 0;
}

.banner-dot.is-active{
  background: var(--txt);
}

/* Responsive tweaks for banners + sections */
@media (max-width: 980px){
  .banner-slider{ margin: 14px 0 22px; }
  .banner-slider-box{ border-radius: 14px; }
  .banner-slider-box{ max-height: 300px; }
}

@media (max-width: 820px){
  .banner-slider-box{ max-height: 260px; }
}

@media (max-width: 640px){
  /* Keep the banner visually compact on phones */
  .banner-slider-box{
    border-radius: 12px;
    max-height: 210px;
  }
  .banner-slide img{
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .banner-dots{ margin-top: 8px; }
  .banner-dot{ width: 7px; height: 7px; }

  /* Projects banners a bit shorter on small screens */
  .proj-banner{ aspect-ratio: 16 / 9; }
  .proj-badge{ bottom: 10px; right: 10px; }
  .proj-body{ padding: 16px; }
}

@media (max-width: 380px){
  .banner-slider-box{ max-height: 185px; }
}

/* كودك الحالي كما هو ... */

/* Desktop fix only (do not affect mobile/tablet) */
@media (min-width: 981px){
  .banner-slider-box{
    aspect-ratio: 1080 / 480;
    height: auto;
    max-height: none;
    overflow: hidden;
  }

  .banner-slide img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center; /* أو center top إذا تريد */
  }
}







/* اجعل كل كرت مشروع بنفس الارتفاع ومحاذاة زر مشاهدة ثابتة */
.project{
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* خلي جسم الكرت يتمدد */
.project .proj-body{
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ادفع منطقة الزر/التاريخ لأسفل */
.project .proj-foot{
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* اختياري: قص الوصف حتى ما يطول كرت عن كرت */
.project .proj-body p{
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; /* عدّلها */
  overflow: hidden;
}

/* مسافة بين التاجز (Tags) وبين زر مشاهدة */
.project .chips{
  margin-bottom: 14px;   /* زِد/قلّل حسب رغبتك */
}

/* أو بدلاً عنها/معها: مسافة أعلى منطقة الزر */
.project .proj-foot{
  padding-top: 10px;     /* اختياري */
}

/* ===== Scroll To Top (Glass) ===== */
.to-top{
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border-radius: 16px;

  display: grid;
  place-items: center;

  border: 1px solid var(--border);
  background: var(--panel2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px rgba(0,0,0,.35);

  color: var(--txt);
  cursor: pointer;
  z-index: 9999;

  opacity: 0;
  transform: translateY(12px) scale(.98);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, background .25s ease, border-color .25s ease;
}

.to-top:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.18);
  transform: translateY(6px) scale(1);
}

.to-top:active{ transform: translateY(7px) scale(.99); }

.to-top.show{
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

@media (max-width: 520px){
  .to-top{ right: 14px; bottom: 14px; }
}
