/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Vazir', 'Inter', sans-serif;
  background: linear-gradient(135deg, #1a1a1a 0%, #121212 100%);
  color: #ddd;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

html {
  direction: rtl;
}

body {
  direction: ltr;
  text-align: right;
}

/* بافت پس‌زمینه نرم */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: url('https://www.transparenttextures.com/patterns/asfalt-dark.png');
  opacity: 0.08;
  z-index: -2;
}

/* خطوط اسکن ریز */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.015),
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: -1;
}

/* Header */
/* هدر اصلی */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(12px);
  z-index: 9999;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.8);
  border-bottom: 1px solid #333;
}

/* کانتینر */
.container-header {
  max-width: 1200px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}

/* لوگو */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #eee;
  user-select: none;
}

.logo img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 50%;
}

/* منو به صورت دکمه */
nav ul {
  display: flex;
  list-style: none;
  gap: 14px;
  padding: 0;
  margin: 0;
}

nav ul li {
  display: flex;
}

nav ul li a {
  padding: 8px 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #bbb;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

nav ul li a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* فقط یک لینک فعال */
nav ul li a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}


/* حالت راست‌چین و چپ‌چین با زبان */
body.lang-en header nav ul {
  direction: ltr;
  justify-content: flex-start;
}

body.lang-fa header nav ul {
  direction: rtl;
  justify-content: flex-end;
}

/* زبان‌ها */
.lang-switch {
  display: flex;
  gap: 10px;
  align-items: center;
}

.lang-switch img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.35s ease, box-shadow 0.3s ease;
  border: 2px solid transparent;
}

.lang-switch img:hover {
  transform: scale(1.1);
  box-shadow: 0 0 8px #aaa;
}

.lang-switch img.active-lang {
  border-color: #bbb;
  box-shadow: 0 0 10px #ccc;
}


/* main */
main {
  flex: 1;
  padding: 140px 30px 60px;
  max-width: 1100px;
  margin: 0 auto;
}

/* hero section */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: 60px 20px;
  background: transparent;
}

.hero-content {
  max-width: 800px;
  padding: 40px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  box-shadow: 0 0 20px rgba(255,255,255,0.03), inset 0 0 5px rgba(255,255,255,0.03);
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 0.3em;
  color: #f2f2f2;
}

.hero h2 {
  font-size: 1.6rem;
  font-weight: 500;
  color: #bbb;
  margin-bottom: 1rem;
}

.hero-location {
  font-size: 1rem;
  color: #888;
  margin-bottom: 2rem;
}

.hero-desc p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #aaa;
}

/* دکمه همبرگر (پیش‌فرض مخفی) */
.burger-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.burger-menu span {
  width: 26px;
  height: 3px;
  background: #ddd;
  border-radius: 2px;
}

/* منوی بازشونده برای موبایل */
@media (max-width: 768px) {
  nav {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #444;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 20px 0;
    z-index: 999;
  }

  nav.open {
    display: flex;
  }

  nav ul {
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }

  .burger-menu {
    display: flex;
  }

  .container-header {
    flex-wrap: wrap;
  }
}

/* موبایل کوچک (تا 480px) */
@media (max-width: 480px) {
  nav ul {
    gap: 12px;
  }

  .container-header {
    padding: 10px;
  }

  .lang-switch {
    gap: 10px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero h2 {
    font-size: 1rem;
  }

  .hero-desc p {
    font-size: 0.95rem;
  }
}


/* footer */
footer {
  background: #111;
  color: #555;
  text-align: center;
  padding: 25px 20px;
  font-size: 0.9rem;
  border-top: 1px solid #222;
  box-shadow: inset 0 1px 4px rgba(255, 255, 255, 0.05);
  user-select: none;
}

/* ریسپانسیو */
@media (max-width: 768px) {
  nav ul {
    gap: 16px;
  }

  .hero h1 {
    font-size: 3rem;
  }

  .hero p {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .container-header {
    flex-direction: column;
    gap: 12px;
  }

  .logo span {
    font-size: 1.2rem;
  }

  nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .lang-switch img {
    width: 36px;
    height: 36px;
  }
}
/* ===== Scrollbar Custom Style ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: #888;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #555 #1a1a1a;
}
.about-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 160px 30px 60px;
  color: #ddd;
  text-align: center;
}

.about-section h1 {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.about-section p {
  font-size: 1.2rem;
  color: #bbb;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.about-section h2 {
  font-size: 2rem;
  margin-bottom: 1.4rem;
  font-weight: 700;
  color: #eee;
}

/* مهارت‌ها */
.skills-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  justify-content: center;
}

.skills-section {
  padding: 100px 20px 60px;
  display: flex;
  justify-content: center;
}

.skills-box {
  background: rgba(255, 255, 255, 0.03);
  padding: 30px 25px;
  border-radius: 16px;
  box-shadow: 0 0 20px rgba(0,0,0,0.35);
  max-width: 960px;
  width: 100%;
  text-align: center;
  color: #eee;
}

.skills-box h2 {
  font-size: 1.8rem;
  margin-bottom: 28px;
}

.skills-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  justify-items: center;
}

.skill-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  width: 120px;
  height: 120px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #ddd;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
}

.skill-box img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.skill-box span {
  font-size: 0.95rem;
  font-weight: 600;
}

/* Hover Animation */
.skill-box:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(200, 200, 200, 0.2);
}

/* Responsive Layout */
@media (max-width: 800px) {
  .skills-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .skills-container {
    grid-template-columns: 1fr;
  }

  .skill-box {
    width: 100%;
    max-width: 200px;
  }
}
/* سکشن پروژه‌ها */
.projects-section {
  padding: 100px 20px 60px;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.projects-section h1 {
  font-size: 2.2rem;
  color: #eee;
  margin-bottom: 40px;
  font-weight: 700;
}

/* شبکه کارت‌ها */
.projects-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  direction: ltr; /* پیش‌فرض انگلیسی */
}

/* اگر زبان فارسی بود، بچرخ به راست‌چین */
body.lang-fa .projects-container {
  direction: rtl;
}

/* کارت پروژه */
.project-card {
  background: rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.6);
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  height: 360px;
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.7);
}

/* تصویر پروژه */
.project-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.25);
  box-shadow: 0 0 8px rgba(255,255,255,0.1);
}

/* محتوای پروژه */
.project-content {
  color: #ddd;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
  padding-bottom: 40px;
  position: relative;
}

.project-content p {
  font-size: 1.05rem;
  color: #bbb;
  line-height: 1.6;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  display: -webkit-box;
  text-overflow: ellipsis;
}

/* دکمه پایین */
.project-content a {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: #aaa;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  transition: all 0.3s ease;
}

.project-content a:hover {
  color: #fff;
  border-color: #fff;
}


@media (max-width: 992px) {
  .projects-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .projects-container {
    grid-template-columns: 1fr;
  }
}
/* ===== Contact Section ===== */
.contact-section {
  padding: 140px 20px 80px;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.contact-container h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: #eee;
  margin-bottom: 0.8em;
}

.contact-container p {
  font-size: 1.2rem;
  color: #bbb;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Contact Boxes ===== */
.contact-boxes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 36px;
}

.contact-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 160px;
  background: rgba(255,255,255,0.05);
  padding: 24px 20px;
  border-radius: 16px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
  text-decoration: none;
  color: #ccc;
  transition: all 0.3s ease;
  cursor: pointer;
}

.contact-box:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.6);
}

.contact-box img {
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.6));
}

.contact-box span {
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .contact-boxes {
    gap: 24px;
  }

  .contact-box {
    width: 140px;
    padding: 20px 16px;
  }

  .contact-box img {
    width: 42px;
    height: 42px;
  }

  .contact-box span {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .contact-boxes {
    flex-direction: column;
    align-items: center;
  }

  .contact-box {
    width: 100%;
    max-width: 300px;
  }
}

.blog-section {
  padding: 140px 30px 60px;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.blog-section h1 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 40px; 
  color: #eee;
}

.blog-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  justify-content: center;
  margin-top: 40px;
}

.blog-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 36px rgba(0,0,0,0.6);
}

.blog-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.blog-content {
  padding: 24px;
  text-align: left;
  color: #ccc;
}

.blog-content h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: #eee;
}

.blog-content p {
  font-size: 1.05rem;
  color: #aaa;
  line-height: 1.6;
  height: 3.5em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.read-more-btn {
  margin-top: 14px;
  background: none;
  border: 1px solid #888;
  color: #ccc;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.read-more-btn:hover {
  background: #eee;
  color: #000;
}
.search-box {
  max-width: 500px;
  margin: 0 auto 45px auto;
  text-align: center;
}

#search-input {
  width: 100%;
  height: 42px;            /* بلندتر */
  padding: 8px 15px;
  font-size: 1.2rem;      /* خواناتر */
  border: 1.8px solid #888;
  border-radius: 10px;
  background: rgba(30, 30, 30, 0.85);
  color: #eee;
  font-family: 'Vazir', 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.3s ease, background 0.3s ease;
  direction: rtl;
}

#search-input::placeholder {
  color: #bbb;
  font-weight: 500;
}

#search-input:focus {
  border-color: #ff6f61;
  background: rgba(40, 40, 40, 0.9);
}

.social-box {
  background-color: rgba(20, 20, 20, 0.9);
  padding: 50px 30px;
  border-radius: 20px;
  margin: 50px auto;
  max-width: 750px;
  text-align: center;
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
}

.social-box h3 {
  color: #e0e0e0;
  font-family: 'Vazir', sans-serif;
  margin-bottom: 30px;
  font-size: 1.8rem;
  letter-spacing: 1px;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 50px;
}

.social-icons a img {
  width: 70px;
  height: 70px;
  filter: grayscale(50%);
  transition: transform 0.4s ease, filter 0.4s ease, box-shadow 0.4s ease;
  transform: perspective(800px) translateZ(0) scale(1);
}

.social-icons a:hover img {
  transform: perspective(800px) translateZ(50px) scale(1.2);
  filter: grayscale(0%);
  z-index: 5;
}

.social-icons a:nth-child(1) img { animation-delay: 0.1s; }
.social-icons a:nth-child(2) img { animation-delay: 0.2s; }
.social-icons a:nth-child(3) img { animation-delay: 0.3s; }
.social-icons a:nth-child(4) img { animation-delay: 0.4s; }

.social-icons a img:hover {
  transform: scale(1.05);
  filter: grayscale(0%);
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@media (max-width: 768px) {
  .social-icons a img {
    width: 64px;
    height: 64px;
  }

  .social-icons {
    gap: 20px;
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .social-icons a img {
    width: 52px;
    height: 52px;
  }
}

