:root{
  --bg:#05070d;
  --bg-soft:#0a0f1d;
  --panel:#10182b;
  --text:#f5f7ff;
  --muted:#98a3bf;
  --line:#192744;
  --accent:#0047FF;
  --primary:#0047FF;
  --primary-strong:#0038cc;
  --primary-soft:#dce7ff;
  --primary-glow:rgba(0,71,255,.30);
  --radius:28px;
  --font-main:'Inter','Cairo',system-ui,sans-serif;
}

body.light-mode{
  --bg:#f4f8ff;
  --bg-soft:#ffffff;
  --panel:#ffffff;
  --text:#0d1528;
  --muted:#5b6785;
  --line:#d8e3ff;
  --accent:#0047FF;
  --primary:#0047FF;
  --primary-strong:#0038cc;
  --primary-soft:#e9f0ff;
  --primary-glow:rgba(0,71,255,.14);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-main);
  overflow-x:hidden;
  transition:background .35s ease,color .35s ease;
}
img{max-width:100%;display:block}
a{text-decoration:none;color:inherit;transition:color .25s ease}
button,input,textarea,select{font:inherit}

::selection{
  background:color-mix(in srgb, var(--primary) 24%, transparent);
  color:var(--text);
}

.noise{
  position:fixed;
  inset:0;
  pointer-events:none;
  opacity:.03;
  background-image:radial-gradient(currentColor 1px, transparent 1px);
  background-size:4px 4px;
  color:var(--text);
}

.site-header{
  position:sticky;
  top:0;
  z-index:50;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  padding:18px 26px;
  border-bottom:1px solid var(--line);
  backdrop-filter:blur(16px);
  background:color-mix(in srgb, var(--bg) 84%, transparent);
}

.brand{
  font-weight:800;
  letter-spacing:.06em;
  z-index:60;
  color:var(--primary);
  text-shadow:0 0 18px var(--primary-glow);
}

.menu-toggle{
  display:none;
  width:48px;
  height:48px;
  border-radius:14px;
  border:1px solid var(--line);
  background:var(--bg-soft);
  box-shadow:0 10px 30px rgba(0,0,0,.08);
  cursor:pointer;
  padding:0;
  position:relative;
  z-index:60;
}
.menu-toggle:hover{border-color:var(--primary)}
.menu-toggle span{
  position:absolute;
  left:12px;
  right:12px;
  height:2px;
  background:var(--text);
  border-radius:999px;
  transition:.28s ease;
}
.menu-toggle span:nth-child(1){top:15px}
.menu-toggle span:nth-child(2){top:23px}
.menu-toggle span:nth-child(3){top:31px}
.menu-toggle.active span:nth-child(1){transform:rotate(45deg);top:23px}
.menu-toggle.active span:nth-child(2){opacity:0}
.menu-toggle.active span:nth-child(3){transform:rotate(-45deg);top:23px}

.nav{
  display:flex;
  gap:18px;
  align-items:center;
  flex-wrap:wrap;
}
.nav a{
  color:var(--text);
  opacity:.92;
  font-weight:500;
}
.nav a:hover,
.nav a.active{
  opacity:1;
  color:var(--primary);
}
.nav-divider{
  width:1px;
  height:42px;
  background:var(--line);
}
.nav-tools{
  display:flex;
  align-items:center;
  gap:12px;
}
.admin-link{opacity:.72}

.lang-menu{position:relative}
.lang-pill{
  min-width:146px;
  height:52px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--bg-soft);
  box-shadow:0 10px 30px rgba(0,0,0,.08);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  color:var(--text);
  cursor:pointer;
  padding:0 16px;
}
.lang-pill-icon{
  width:28px;
  height:28px;
  border-radius:50%;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
}
.lang-pill-text{
  font-weight:700;
  letter-spacing:.08em;
  font-size:.92rem;
}
.lang-dropdown{
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  min-width:180px;
  background:var(--bg-soft);
  border:1px solid var(--line);
  border-radius:18px;
  padding:8px;
  box-shadow:0 18px 48px rgba(0,0,0,.24);
  display:none;
}
.lang-dropdown.show{display:block}
.lang-dropdown button{
  width:100%;
  text-align:left;
  background:transparent;
  border:none;
  color:var(--text);
  padding:12px 14px;
  border-radius:12px;
  cursor:pointer;
}
.lang-dropdown button:hover{
  background:color-mix(in srgb, var(--primary) 10%, var(--bg));
  color:var(--primary);
}

.theme-toggle{
  width:52px;
  height:52px;
  border-radius:50%;
  border:1px solid var(--line);
  background:var(--bg-soft);
  color:var(--primary);
  box-shadow:0 10px 30px rgba(0,0,0,.08);
  display:grid;
  place-items:center;
  cursor:pointer;
}
.theme-toggle:hover{border-color:var(--primary)}

.section{
  width:min(1200px, calc(100% - 40px));
  margin:0 auto;
  padding:90px 0;
}

.hero{
  display:grid;
  grid-template-columns:1.1fr .9fr;
  align-items:center;
  gap:44px;
  min-height:calc(100vh - 90px);
}
.eyebrow,
.section-head span,
.contact-copy span{
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.14em;
  font-size:.84rem;
}
.hero h1{
  font-size:clamp(3.2rem, 10vw, 7rem);
  line-height:.9;
  margin:.35em 0 .15em;
  font-weight:800;
}
.hero h1 .muted{
  color:color-mix(in srgb, var(--text) 35%, transparent);
}
.hero p{
  max-width:760px;
  color:color-mix(in srgb, var(--text) 82%, transparent);
  font-size:1.08rem;
  line-height:1.85;
}
.cta-row{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  margin:28px 0 36px;
}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:15px 22px;
  border-radius:999px;
  border:1px solid var(--line);
  transition:.25s ease;
  cursor:pointer;
}
.btn:hover{transform:translateY(-2px)}
.btn-solid{
  background:linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-color:transparent;
  color:#fff;
  box-shadow:0 18px 44px var(--primary-glow);
}
.btn-solid:hover{
  box-shadow:0 24px 54px var(--primary-glow);
}
.btn-ghost{
  background:color-mix(in srgb, var(--primary) 8%, transparent);
  color:var(--text);
}
.btn-ghost:hover{
  border-color:var(--primary);
  color:var(--primary);
}
.stats{
  display:flex;
  gap:28px;
  flex-wrap:wrap;
}
.stats strong{
  display:block;
  font-size:1.7rem;
}
.stats span{color:var(--muted)}

.hero-visual{
  position:relative;
  min-height:520px;
  display:grid;
  place-items:center;
  perspective:1200px;
  isolation:isolate;
}
.hero-visual::before{
  content:"";
  position:absolute;
  width:min(620px, 98%);
  aspect-ratio:1/1;
  border-radius:42px;
  background:
    radial-gradient(circle at 50% 40%, rgba(0,71,255,.22), transparent 42%),
    radial-gradient(circle at 60% 60%, rgba(0,149,255,.14), transparent 48%);
  filter:blur(36px);
  opacity:.95;
  z-index:0;
  pointer-events:none;
}
.hero-visual img{
  position:relative;
  z-index:1;
  width:min(560px, 90%);
  aspect-ratio:1/1;
  object-fit:cover;
  border-radius:36px;
  border:none;
  box-shadow:
    0 40px 120px rgba(0,0,0,.28),
    0 0 0 1px rgba(255,255,255,.02),
    0 0 60px rgba(0,71,255,.18),
    0 0 120px rgba(0,149,255,.10);
  transform:translate3d(0,0,0);
  transition:
    transform .18s ease,
    box-shadow .28s ease,
    filter .28s ease;
  will-change:transform;
  backface-visibility:hidden;
}
.hero-visual:hover img{
  box-shadow:
    0 46px 140px rgba(0,0,0,.34),
    0 0 0 1px rgba(255,255,255,.03),
    0 0 70px rgba(0,71,255,.24),
    0 0 140px rgba(0,149,255,.14);
}
.hero-visual .orb{
  transition:transform .25s ease, opacity .25s ease;
  will-change:transform;
}
.hero-visual:hover .orb{
  transform:scale(1.04) translateY(-8px);
  opacity:1;
}
@media (hover:none){
  .hero-visual img{
    transition:transform .25s ease, box-shadow .28s ease, filter .28s ease;
  }
}

.orb{
  position:absolute;
  inset:12% 10% auto auto;
  width:300px;
  height:300px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(0,71,255,.32), rgba(0,0,0,0) 68%);
  filter:blur(20px);
}

.about-section{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:70px;
  align-items:center;
}
.about-image-wrap{
  display:flex;
  justify-content:center;
  align-items:center;
  position:relative;
}
.about-image-wrap::before{
  content:"";
  position:absolute;
  width:min(580px, 108%);
  aspect-ratio:1/1;
  border-radius:40px;
  background:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,.05), transparent 38%),
    radial-gradient(circle at 55% 60%, rgba(0,71,255,.18), transparent 52%);
  filter:blur(34px);
  z-index:0;
  pointer-events:none;
}
.about-main-image{
  position:relative;
  z-index:1;
  width:min(520px, 100%);
  aspect-ratio:1/1;
  object-fit:cover;
  border-radius:34px;
  filter:grayscale(100%);
  transition:filter .45s ease, transform .35s ease;
  border:none;
  box-shadow:
    0 30px 90px rgba(0,0,0,.30),
    0 0 0 1px rgba(255,255,255,.02),
    0 0 44px rgba(0,71,255,.16);
}
.about-main-image:hover{
  filter:grayscale(0%);
  transform:translateY(-4px);
}
.about-content > span{
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.14em;
  font-size:.84rem;
}
.about-content h2{
  font-size:clamp(2.2rem, 4vw, 4rem);
  margin:10px 0 24px;
  color:var(--text);
  font-weight:800;
  line-height:1.05;
}
.about-content p{
  color:color-mix(in srgb, var(--text) 82%, transparent);
  line-height:1.9;
  font-size:1.05rem;
  margin-bottom:18px;
}
.about-tags{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin:28px 0 34px;
}
.about-tags span,
.year-pill,
.tag{
  background:color-mix(in srgb, var(--bg-soft) 75%, transparent);
  border:1px solid var(--line);
  padding:10px 16px;
  border-radius:999px;
}
.about-skills{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:28px;
  margin-bottom:30px;
}
.about-skills h4,
.about-edu h4{
  color:var(--primary);
  letter-spacing:.12em;
  font-size:.95rem;
  margin-bottom:14px;
}
.about-skills ul{
  list-style:none;
  padding:0;
  margin:0;
}
.about-skills li{
  position:relative;
  padding-left:18px;
  margin-bottom:12px;
  color:var(--text);
}
.about-skills li::before{
  content:"â€¢";
  position:absolute;
  left:0;
  color:var(--primary);
}
.about-edu p{
  margin:0;
  color:color-mix(in srgb, var(--text) 88%, transparent);
}

.section-head{
  display:flex;
  justify-content:space-between;
  gap:20px;
  align-items:end;
  margin-bottom:26px;
}
.section-head h2,
.contact-copy h2,
.listing-hero h1{
  font-size:clamp(2rem,4vw,4rem);
  line-height:1.05;
  margin:.22em 0;
}
.view-more-link{
  display:inline-flex;
  align-items:center;
  gap:10px;
  color:var(--primary);
  font-weight:700;
}

.project-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:22px;
}
.project-grid-wide{
  grid-template-columns:repeat(3,1fr);
}

.project-card{
  position:relative;
  background:linear-gradient(180deg, color-mix(in srgb, var(--bg-soft) 92%, transparent), color-mix(in srgb, var(--bg-soft) 80%, transparent));
  border:1px solid var(--line);
  border-radius:28px;
  padding:14px;
  overflow:hidden;
  box-shadow:0 18px 44px rgba(0,0,0,.08);
  transition:border-color .28s ease, box-shadow .28s ease, transform .28s ease;
}
.project-card:hover{
  border-color:color-mix(in srgb, var(--primary) 58%, var(--line));
  box-shadow:0 24px 54px rgba(0,0,0,.12), 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
  transform:translateY(-4px);
}
.project-card-image{
  position:relative;
  overflow:hidden;
  border-radius:20px;
  margin-bottom:16px;
}
.project-card img{
  height:280px;
  width:100%;
  object-fit:cover;
  transition:transform .45s ease;
}
.project-card:hover img{
  transform:scale(1.06);
}
.hover-overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:end;
  padding:18px;
  background:linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,.08));
  backdrop-filter:blur(7px);
  opacity:0;
  transition:.35s ease;
}
.project-card:hover .hover-overlay,
.gallery-item:hover .hover-overlay{
  opacity:1;
}
.hover-overlay-content{
  width:100%;
}
.hover-overlay-title{
  font-size:1rem;
  font-weight:700;
  margin-bottom:8px;
  color:#fff;
}
.hover-overlay-text{
  font-size:.92rem;
  line-height:1.6;
  color:rgba(255,255,255,.88);
}
.project-card h3{
  font-size:1.35rem;
  margin:0 0 8px;
}
.project-card p{
  color:var(--muted);
  line-height:1.7;
  margin:0;
}
.project-meta{
  display:flex;
  justify-content:flex-end;
  margin-bottom:8px;
}
.tag{
  font-size:.82rem;
  color:var(--primary);
  letter-spacing:.12em;
}

.gallery-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:18px;
}
.gallery-grid-full{
  grid-template-columns:repeat(3,1fr);
}
.gallery-item{
  position:relative;
  overflow:hidden;
  border-radius:26px;
  border:1px solid var(--line);
  background:var(--bg-soft);
  box-shadow:0 18px 44px rgba(0,0,0,.08);
  transition:border-color .28s ease, box-shadow .28s ease, transform .28s ease;
}
.gallery-item:hover{
  border-color:color-mix(in srgb, var(--primary) 52%, var(--line));
  box-shadow:0 24px 54px rgba(0,0,0,.12), 0 0 0 1px color-mix(in srgb, var(--primary) 16%, transparent);
  transform:translateY(-4px);
}
.gallery-item img{
  width:100%;
  height:280px;
  object-fit:cover;
  transition:transform .45s ease;
}
.gallery-item:hover img{
  transform:scale(1.06);
}

.links-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
}

.social-card{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  min-height:76px;
  padding:18px 20px;
  border-radius:20px;
  border:1px solid var(--line);
  background:color-mix(in srgb, var(--bg-soft) 90%, transparent);
  color:var(--text);
  transition:.25s ease;
  box-shadow:0 16px 34px rgba(0,0,0,.06);
}

.social-card:hover{
  transform:translateY(-4px);
  border-color:color-mix(in srgb, var(--primary) 52%, var(--line));
  box-shadow:0 18px 40px rgba(0,0,0,.16), 0 0 0 1px color-mix(in srgb, var(--primary) 16%, transparent);
}

.social-card-left{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.social-icon{
  width:42px;
  height:42px;
  border-radius:14px;
  border:1px solid color-mix(in srgb, var(--primary) 20%, var(--line));
  background:color-mix(in srgb, var(--primary) 10%, var(--bg));
  color:var(--primary);
  display:grid;
  place-items:center;
  flex-shrink:0;
}

.social-label-text{
  font-weight:600;
  line-height:1.4;
  word-break:break-word;
}

.social-arrow{
  opacity:.62;
  flex-shrink:0;
}

.contact-grid{
  display:grid;
  grid-template-columns:.9fr 1.1fr;
  gap:40px;
}
.contact-copy p{
  color:color-mix(in srgb, var(--text) 82%, transparent);
  line-height:1.8;
}
.contact-form{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
  background:color-mix(in srgb, var(--bg-soft) 92%, transparent);
  border:1px solid var(--line);
  box-shadow:0 18px 44px rgba(0,0,0,.08);
  padding:24px;
  border-radius:28px;
}
.contact-form input,
.contact-form textarea{
  width:100%;
  background:color-mix(in srgb, var(--bg) 72%, transparent);
  border:1px solid var(--line);
  color:var(--text);
  border-radius:16px;
  padding:16px;
  transition:border-color .2s ease, box-shadow .2s ease;
}
.contact-form input:focus,
.contact-form textarea:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent);
  outline:none;
}
.contact-form textarea{
  min-height:160px;
  grid-column:1/-1;
  resize:vertical;
}
.contact-form button{
  grid-column:1/-1;
}

.site-footer{
  width:min(1200px, calc(100% - 40px));
  margin:0 auto;
  padding:30px 0 60px;
  color:var(--muted);
  border-top:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.listing-hero{
  padding-bottom:20px;
}
.listing-hero p{
  max-width:760px;
  color:var(--muted);
  line-height:1.8;
}

.reveal{
  opacity:0;
  transform:translateY(24px);
  transition:opacity .8s ease, transform .8s ease;
}
.reveal.visible{
  opacity:1;
  transform:none;
}

.tilt-card{
  transform-style:preserve-3d;
  transition:transform .18s ease;
}

body[data-lang="ar"]{
  font-family:'Cairo',sans-serif;
}
body[data-lang="ar"] .hero,
body[data-lang="ar"] .about-section,
body[data-lang="ar"] .contact-grid{
  direction:rtl;
}
body[data-lang="ar"] .nav{
  direction:rtl;
}
body[data-lang="ar"] .social-card{
  direction:rtl;
}

@media (max-width:1100px){
  .hero{
    grid-template-columns:1fr;
    min-height:auto;
    padding-top:30px;
  }
  .hero-visual{min-height:auto}
  .project-grid,
  .project-grid-wide,
  .gallery-grid,
  .gallery-grid-full,
  .links-grid{
    grid-template-columns:repeat(2,1fr);
  }
}

@media (max-width:900px){
  .menu-toggle{display:block}
  .site-header{
    padding:16px;
  }
  .nav{
    position:fixed;
    top:78px;
    left:12px;
    right:12px;
    background:var(--bg-soft);
    border:1px solid var(--line);
    border-radius:24px;
    padding:18px;
    display:none;
    flex-direction:column;
    align-items:flex-start;
    gap:14px;
    box-shadow:0 30px 80px rgba(0,0,0,.28);
  }
  .nav.show{display:flex}
  .nav a{
    width:100%;
    padding:4px 0;
  }
  .nav-divider{
    width:100%;
    height:1px;
  }
  .nav-tools{
    width:100%;
    justify-content:space-between;
  }
  .about-section,
  .contact-grid{
    grid-template-columns:1fr;
    gap:40px;
  }
  .about-main-image{
    width:min(420px,100%);
  }
  .about-skills{
    grid-template-columns:1fr;
  }
  .section-head{
    align-items:start;
    flex-direction:column;
  }
  .contact-form{
    grid-template-columns:1fr;
  }
}

@media (max-width:700px){
  .section{
    width:min(100% - 24px, 1200px);
    padding:70px 0;
  }
  .hero h1{
    font-size:clamp(2.4rem,16vw,4.8rem);
  }
  .hero p,
  .about-content p,
  .contact-copy p{
    font-size:.98rem;
  }
  .project-grid,
  .project-grid-wide,
  .gallery-grid,
  .gallery-grid-full,
  .links-grid{
    grid-template-columns:1fr;
  }
  .project-card img,
  .gallery-item img{
    height:220px;
  }
  .stats{
    gap:16px;
  }
  .lang-pill{
    min-width:132px;
    height:50px;
  }
  .theme-toggle{
    width:50px;
    height:50px;
  }
  .site-footer{
    flex-direction:column;
  }
}

@media (hover:none){
  .about-main-image{
    filter:grayscale(0%);
  }
}

.article-content img,
.blog-content img {
  max-width: 420px;
  width: 100%;
  border-radius: 22px;
  display: block;
  margin: 24px auto;
}

/* Blog cards on home page + blog page */
.blog-card-image{
  border-radius: 22px;
  overflow: hidden;
}

.blog-card-image img{
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

/* Article page images */
.article-cover,
.article-inner-image{
  width: 100%;
  max-width: 420px;
  height: 280px;
  object-fit: cover;
  display: block;
  margin: 24px auto;
  border-radius: 22px;
  overflow: hidden;
}




/* ===== LOGO UPGRADE ===== */
.brand{
  font-size:32px;
  font-weight:900;
  letter-spacing:.08em;
  color:var(--primary);
  text-shadow:0 0 18px var(--primary-glow);
  display:flex;
  align-items:center;
  gap:4px;
}

.brand span{
  color:var(--text);
}

/* ===== SAAD BLUE ===== */
.blue{
  color:var(--primary);
  text-shadow:0 0 12px var(--primary-glow);
}
