* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  list-style: none;
  border: none;
  outline: none;
  scroll-behavior: smooth;
}

:root {
  --bg-color: #080808;
  --second-bg-color: #131313;
  --text-color: white;
  --main-color: #00ffee;
}
html {
  font-size: 60%;
  /* overflow: hidden;*/
}
body {
  background: var(--bg-color);
  color: var(--text-color);
  direction: rtl;
  text-align: right;
  font-family: "Vazirmatn", sans-serif;
}
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 4rem 12% 4rem;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
}
.logo {
  font-size: 3rem;
  color: var(--text-color);
  font-weight: 800;
  cursor: pointer;
  transition: 0.3s ease;
}
.logo:hover {
  transform: scale(1.1);
}
.logo span {
  text-shadow: 0 0 25px var(--main-color);
}
.navbar a {
  font-size: 1.8rem;
  color: var(--text-color);
  margin-left: 4rem;
  font-weight: 500;
  transition: 0.3s ease;
  border-bottom: 3px solid transparent;
}
.navbar a:hover,
.navbar a.active {
  color: var(--main-color);
  border-bottom: 3px solid var(--main-color);
}
#menu-icon {
  font-size: 3.6rem;
  color: var(--main-color);
  display: none;
}
/********************** section ************************/
section {
  padding: 10rem 12% 10rem;
  min-height: 100vh;
}
.home {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15rem;
}

.home-content {
  display: flex;
  flex-direction: column;
  justify-content: baseline;
  align-items: baseline;
  text-align: right;
  margin-top: 3rem;
  max-width: 100%;
  flex-wrap: nowrap;
}
span {
  color: var(--main-color);
}
.logo span {
  color: var(--main-color);
}
.home-content h3 {
  margin-bottom: 2rem;
  margin-top: 1rem;
  font-size: 3.5rem;
}
.home-content h1 {
  font-size: 7rem;
  font-weight: 700;
  margin-top: 1.5rem;
  line-height: 1;
}
.home-img {
  border-radius: 50%;
}
.home-img img {
  width: 32vw;
  border-radius: 50%;
  box-shadow: 0 0 25px var(--main-color);
  transition: 0.4s ease-in-out;
  cursor: pointer;
  position: relative;
  top: 3rem;
}
.home-img img:hover {
  box-shadow: 0 0 25px var(--main-color), 0 0 50px var(--main-color),
    0 0 100px var(--main-color);
}
.home-content p {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.8rem;
  max-width: 1000px;
}

.social-icons a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 4.5rem;
  height: 4.5rem;
  background: transparent;
  border: 2px solid var(--main-color);
  font-size: 2.5rem;
  color: var(--main-color);
  border-radius: 50%;
  margin: 3rem 1.5rem 3rem 0;
  transition: 0.3s ease-in-out;
}
.social-icons {
  display: flex;
  justify-content: flex-start;
  direction: rtl;
  width: 100%;
}

.social-icons a:hover {
  color: var(--text-color);
  transform: scale(1.3) translateY(-5px);
  box-shadow: 0 0 25px var(--main-color);
  background-color: var(--main-color);
}
.btn {
  display: inline-block;
  padding: 1rem 2.8rem;
  font-size: 1.6rem;
  color: black;
  background: var(--main-color);
  border-radius: 4rem;
  transition: 0.3s ease-in-out;
  box-shadow: 0 0 25px var(--main-color);
  border: 2px solid transparent;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.1rem;
}
.btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 50px var(--main-color);
}
.btn-group {
  display: flex;
  justify-content: flex-end;
  flex-direction: row-reverse;
  gap: 2rem;
  width: 100%;
}

.btn-group a:nth-of-type(2) {
  background-color: black;
  color: var(--main-color);
  border: 2px solid var(--main-color);
  box-shadow: 0 0 25px transparent;
}
.btn-group a:nth-of-type(2):hover {
  background-color: var(--main-color);
  box-shadow: 0 0 25px var(--main-color);
  color: black;
}
.text-animation {
  font-size: 3rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  width: 22ch; /* عرض ثابت معادل طولانی‌ترین متن */
  display: inline-block;
  text-align: left;
}
.text-animation span {
  position: relative;
}
.text-animation span::before {
  content: "web developer";
  color: var(--main-color);
  animation: words 20s infinite;
}
.text-animation span::after {
  content: "";
  background-color: var(--bg-color);
  position: absolute;
  height: 100%;
  border-left: 3px solid var(--bg-color);
  right: -8px;
  top: 0;
  animation: cursor 0.6s infinite, typing 20s steps(30) infinite;
  width: 100%; /* اضافه کن برای جلوگیری از شکست */
}

@keyframes cursor {
  to {
    border-left: 2px solid var(--main-color);
  }
}
@keyframes words {
  0%,
  20% {
    content: "Front-End  Developer";
  }
  21%,
  40% {
    content: "JavaScript Developer";
  }
  41%,
  60% {
    content: "Web Developer";
  }
  61%,
  80% {
    content: "UI/UX Designer";
  }
  81%,
  100% {
    content: "Wordpress Developer";
  }
}
@keyframes typing {
  10%,
  15%,
  30%,
  35%,
  50%,
  55%,
  70%,
  75%,
  90%,
  95% {
    width: 0;
  }
  5%,
  20%,
  25%,
  40%,
  45%,
  60%,
  65%,
  80%,
  85% {
    width: calc(100% + 8px);
  }
}

/********************** Education ************************/
.heading {
  font-size: 8rem;
  text-align: center;
  margin: 5rem 0;
}

.about-me {
  padding: 100px 15px;
  background: var(--second-bg-color);
}
.about-me h2 {
  margin-bottom: 5rem;
}
.timeline-items {
  max-width: 1200px;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  position: relative;
}
.timeline-items::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 100%;
  background-color: var(--main-color);
  left: calc(50% - 1px);
}
.timeline-item {
  margin-bottom: 40px;
  width: 100%;
  position: relative;
}
.timeline-item:last-child {
  margin-bottom: 0;
}
.timeline-item:nth-child(odd) {
  padding-right: calc(50% + 30px);
  text-align: right;
}
.timeline-item:nth-child(even) {
  padding-left: calc(50% + 30px);
}
.timeline-dot {
  height: 21px;
  width: 21px;
  background-color: var(--main-color);
  box-shadow: 0 0 25px var(--main-color), 0 0 50px var(--main-color);
  position: absolute;
  left: calc(50% - 8px);
  top: 10px;
  border-radius: 50%;
}
.timeline-date {
  font-size: 20px;
  font-weight: 800;
  color: white;
  margin: 6px 0 15px;
}
.timeline-content {
  background-color: var(--bg-color);
  border: 3px solid var(--main-color);
  padding: 30px 50px;
  border-radius: 4rem;
  box-shadow: 0 0 10px var(--main-color);
  cursor: pointer;
  transition: 0.3s ease-in-out;
}
.timeline-content:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px var(--main-color);
}
.timeline-content h3 {
  font-size: 20px;
  color: white;
  margin: 0 0 10px;
  font-weight: 500;
}
.timeline-content p {
  color: white;
  font-size: 16px;
  line-height: 22px;
  font-weight: 300;
}
::-webkit-scrollbar {
  width: 15px;
}
::-webkit-scrollbar-thumb {
  background-color: var(--main-color);
}
::-webkit-scrollbar-track {
  background-color: var(--bg-color);
  width: 50px;
}

/* *********************** */

.services {
  background-color: var(--bg-color);
  color: black;
}
.services h2 {
  margin-bottom: 5rem;
  color: white;
}

.services-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  gap: 2.5rem;
}

.services-box {
  background-color: var(--main-color);
  height: 300px;
  border-radius: 3rem;
  border: 5px solid transparent;
  cursor: pointer;
  transition: 0.4s ease;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.services-box:hover {
  background: white;
  color: black;
  border: 5px solid var(--main-color);
  transform: scale(1.03);
}
.services-box .services-info {
  display: flex;
  flex-direction: column;
  text-align: right;
  max-height: 200px;
  justify-content: flex-end;
  align-items: baseline;
  padding: 1rem 4rem;
}
.services-info h4 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 2;
  text-align: right;
}
.services-info p {
  font-size: 1.6rem;
  font-weight: 600;
  max-height: 1000px;
  line-height: 2;
  text-align: right;
  margin: auto;
}

/* نمونه کارها */

.portfolio {
  background-color: var(--second-bg-colorcolor);
}
.portfolio-box {
  background-color: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.portfolio .heading {
  margin-bottom: 5rem;
}
.portfolio-box img {
  width: 100%;
  height: auto; /* 👈 خیلی مهم */
  aspect-ratio: 4 / 3; /* 👈 نسبت تصویر کنترل‌شده، اختیاری ولی مفید */
  object-fit: cover;
  border-radius: 10%;
  border: 3px solid var(--main-color);
  box-shadow: 0 0 15px rgba(0, 255, 238, 0.3);
  transition: transform 0.3s ease-in-out;
}

.wrapper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
}
.portfolio-item {
  min-height: 450px;
  max-width: 450px;
  background: rgba(0, 0, 0, 0.7);
  border: 3px solid rgba(238, 238, 238, 0.2);
  border-radius: 2rem;
  margin: 0 2rem;
  padding: 10px 60px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.5rem;
  color: white;
  transition: 0.4s ease-in-out;
  z-index: 2;
  position: relative;
  box-shadow: 0 0 8px rgba(0, 255, 238, 0.5); /* ساده و تمیز */
  transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
}
.portfolio-item:hover {
  border: 3px solid var(--main-color);
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 0 15px rgba(0, 255, 238, 0.8); /* در هاور کمی برجسته‌تر */
  transform: translateY(-5px);
}
.portfolio-item h2 {
  font-size: 2.8rem;
}
.portfolio-item p {
  font-size: 1.3rem;
}
#star {
  color: gold;
  font-size: 2rem;
}

.contact {
  background-color: var(--bg-color);
}
.contact h2 {
  margin-bottom: 3rem;
  color: white;
}
.contact form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  margin: 5rem auto;
  text-align: center;
}

.contact form .input-box {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}
.contact form .input-box input,
.contact form textarea {
  width: 100%;
  padding: 2.5rem;
  font-size: 1.8rem;
  color: var(--text-color);
  background-color: var(--second-bg-color);
  border-radius: 2rem;
  border: 2px solid var(--main-color);
  margin: 1.5rem 0;
  resize: none;
}
.contact form .btn {
  margin-top: 2rem;
}
.footer {
  position: relative;
  bottom: 0;
  width: 100%;
  padding: 40px 0;
  background-color: var(--second-bg-color);
}
.footer .social {
  text-align: center;
  padding-bottom: 25ex;
  color: var(--main-color);
}
.footer .social a {
  font-size: 25px;
  color: var(--main-color);
  border: 2px solid var(--main-color);
  border: 2px solid var(--main-color);
  width: 42px;
  height: 42px;
  line-height: 42px;
  display: inline-flex;
  text-align: center;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  margin: 0 10px;
  transition: 0.3s ease-in-out;
}
.footer .social a:hover {
  transform: scale(1.2) translateY(-10px);
  background-color: var(--main-color);
  color: black;
  box-shadow: 0 0 25px var(--main-color);
}
.footer ul {
  margin-top: 0;
  padding: 0;
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 0;
  text-align: center;
}
.footer ul li a {
  color: white;
  border-bottom: 3px solid transparent;
  transition: 0.3s ease-in-out;
}
.footer ul li a:hover {
  border-bottom: 3px solid var(--main-color);
}
.footer ul li {
  display: inline-block;
  padding: 0 15px;
}
.footer .copyright {
  margin-top: 50px;
  text-align: center;
  font-size: 16px;
  color: white;
}

@media (max-width: 1200px) {
  html {
    font-size: 55%;
  }
  .services-container {
    padding-bottom: 7rem;
    grid-template-columns: repeat(2, 1fr);
    margin: 0 5rem;
  }
}
@media (max-width: 991px) {
  header {
    padding: 2rem 3%;
  }
  section {
    padding: 10rem 3% 2rem;
  }
  .timeline-item::before {
    left: 7px;
  }
  .timeline-item:nth-child(odd) {
    padding-right: 0;
    text-align: right;
  }
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    padding-left: 37px;
  }
  .timeline-dot {
    left: 0;
  }
  .services {
    padding-bottom: 7rem;
  }
  .portfolio .wrapper {
    grid-template-columns: repeat(1, 1fr);
  }
  .contact form {
    flex-direction: column;
  }
  .footer {
    padding: 2rem 3%;
  }
}

@media (max-width: 895px) {
  #menu-icon {
    display: block;
  }
  .navbar {
    position: absolute;
    top: 100%;
    width: 50%;
    padding: 1rem 3%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-bottom-left-radius: 2rem;
    border-left: 2px solid var(--second-bg-color);
    border-bottom: 2px solid var(--main-color);
    display: none;
  }

  .navbar.active {
    display: block;
  }
  .navbar a {
    display: block;
    font-size: 2rem;
    margin: 3rem 0;
    color: white;
  }
  .home {
    flex-direction: column-reverse;
    margin: 5rem 4rem;
  }
  .home-content h3 {
    font-size: 2.6rem;
  }
  .home-content h1 {
    font-size: 8rem;
    margin-top: 3rem;
  }
  .home-content p {
    max-width: 600px;
    margin: 0 auto;
  }
  .home-img img {
    width: 56vw;
  }
  .services h2 {
    margin-bottom: 3rem;
  }
  .services-container {
    grid-template-columns: repeat(1, 1fr);
  }
  .btn-group {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 1.5rem;
    padding: 3rem;
  }

  .social-icons {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .social-icons a {
    margin: 0.5rem;
  }
}

/* غیرفعال‌سازی گرید قبلی */
.wrapper {
  display: unset !important;
}

/* هر اسلاید یک کارت وسط‌چین */
.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 0;
  pointer-events: auto;
}
.swiper-slide a {
  display: block;
  text-decoration: none;
  color: inherit;
}
.portfolio-link {
  text-decoration: none;
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
}
/* تنظیم عرض قابل کنترل */
.portfolio-slider {
  width: 100%;
  overflow: hidden;
  padding: 10rem;
}

.portfolio-item {
  width: 90%;
  max-width: 360px;
  min-width: 260px;

  padding: 2rem;
}

/* جلوگیری از اسکرول افقی کلی صفحه */
body {
  overflow-x: hidden;
}

/* دکمه‌ها و صفحه‌بندی */
.swiper-button-next,
.swiper-button-prev {
  color: var(--main-color);
}
.swiper-pagination-bullet-active {
  background: var(--main-color);
}
.swiper-pagination {
  display: none !important;
}
.portfolio-section {
  padding: 0 2rem; /* یا بیشتر */
  overflow: visible;
}

.swiper {
  overflow: visible;
  z-index: 0;
}

.swiper-button-next,
.swiper-button-prev {
  display: none !important;
}

/* .swiper-slide {
    overflow: visible !important;
    
  } */

/* .swiper-wrapper {
    overflow: visible !important;
  }
  
  .swiper {
    overflow: visible !important;
  }  */

@media (max-width: 600px) {
  .home {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem;
    gap: 2rem;
  }
  .home-content {
    align-items: center;
    text-align: center;
  }
  .home-img img {
    width: 70vw;
    margin-top: 3rem;
  }

  .home-content h1 {
    font-size: 4rem;
    text-align: center;
  }

  .home-content h3 {
    font-size: 2.4rem;
    text-align: center;
  }

  .services-container {
    grid-template-columns: 1fr;
  }

  .timeline-items::before {
    left: 10px;
  }
  .portfolio-slider {
    padding: 2rem 1rem !important;
  }
  html {
    font-size: 50%;
  }

  .home-content h1 {
    font-size: 4rem;
  }

  .home-content h3 {
    font-size: 2.4rem;
  }

  .services-info h4 {
    font-size: 2.2rem;
  }

  .services-info p {
    font-size: 1.4rem;
  }
  .home-content {
    align-items: center;
    text-align: center;
  }

  .text-animation {
    width: 22ch;
    font-size: 2.4rem;
  }

  .btn-group {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 1.5rem;
    padding: 3rem;
  }

  .btn-group a {
    width: 80%;
  }

  .social-icons {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .social-icons a {
    margin: 0.5rem;
  }
}
