/* Comments Section */
.comments-section {
  background: var(--bg);
}

.comments-form-container {
  background: var(--card);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 3rem;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.loading-comments {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
  font-size: 14px;
}

.comment-item {
  background: var(--card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  position: relative;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 16px;
}

.comment-info {
  flex: 1;
}

.comment-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.comment-date {
  font-size: 12px;
  color: var(--muted);
}

.comment-text {
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.comment-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.comment-reply-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.comment-reply-btn:hover {
  background: rgba(59, 130, 246, 0.1);
}

.comment-replies {
  margin-top: 1rem;
  padding-left: 2rem;
  border-left: 2px solid var(--border);
}

.reply-form {
  background: var(--bg);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  display: none;
}

.reply-form.active {
  display: block;
}

.reply-form textarea {
  width: 100%;
  min-height: 80px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  margin-bottom: 0.5rem;
}

.reply-form .btn-send {
  padding: 6px 12px;
  font-size: 12px;
}

.admin-reply {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.1),
    rgba(147, 51, 234, 0.1)
  );
  border-left-color: var(--primary);
}

.admin-reply .comment-avatar {
  background: linear-gradient(135deg, #10b981, #059669);
}

.admin-reply .comment-name::after {
  content: " (مدیر)";
  color: var(--primary);
  font-size: 11px;
  font-weight: 500;
}

/* Dark mode for comments */
[data-theme="dark"] .comments-form-container {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group textarea:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .reply-form textarea {
  background: var(--card);
  border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .comment-replies {
  border-left-color: rgba(255, 255, 255, 0.14);
}

/* Responsive comments */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .comment-replies {
    padding-left: 1rem;
  }

  .comments-form-container {
    padding: 1.5rem;
  }
}
@font-face {
  font-family: lalezar;
  src: url("fonts/TTF/Lalezar-Regular.ttf") format("truetype"),
    url("fonts/OTF/Lalezar-Regular.otf") format("opentype");
}
@font-face {
  font-family: rokh;
  src: url("fonts/TTF/Rokh-Medium.ttf") format("truetype");
}

:root {
  --bg: #f6f7fb;
  --card: #fff;
  --text: #0f1724;
  --muted: #6b7280;
  --primary: #0b72ff;
  --accent: #ff7a00;
  --glass: rgba(158, 158, 158, 0.6);
  --radius: 14px;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --card: #101827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #3b82f6;
  --accent: #f59e0b;
  --glass: rgba(31, 41, 55, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}
body {
  font-family: lalezar, tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 1rem;
}
a {
  text-decoration: none;
  color: inherit;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

/* header */
header {
  position: relative;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  background: var(--bg);
}
.theme-toggle {
  border: none;
  background: var(--card);
  color: var(--text);
  padding: 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.08);
}
.theme-toggle:hover {
  background: linear-gradient(90deg, rgb(248, 244, 132), var(--accent));
  color: #fff;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
/* logo mark is defined later to include animation */
/* (animation consolidated later) */
.brand {
  font-weight: 700;
  font-size: 1.125rem;
}
nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s ease;
}
nav a {
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.875rem;
  transition: all 0.3s ease;
}
nav a:hover,
.secondary:hover {
  background: linear-gradient(90deg, rgb(248, 244, 132), var(--accent));
  color: #fff;
}

.cta {
  background: linear-gradient(90deg, #40f16a, #3aa0ff);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(11, 114, 255, 0.12);
}

.portfolio-slider .arrow {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  font-size: 1.2rem;
  padding: 0.75rem;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  margin: 0 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(2, 6, 23, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

.portfolio-slider .arrow:hover {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(2, 6, 23, 0.25);
}

.portfolio-slider .arrow:active {
  transform: scale(0.95);
}
.portfolio-slider .arrow.left {
  margin-right: 0.5rem;
}
.portfolio-slider .arrow.right {
  margin-left: 0.5rem;
}
.portfolio-slider .portfolio-grid {
  display: flex;
  gap: 1.25rem;
  overflow: hidden;
  scroll-behavior: smooth;
  flex: 1;
  padding: 0.5rem 0;
}
.project {
  min-width: 300px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s ease;
  box-shadow: 0 4px 20px rgba(2, 6, 23, 0.08);
  background: var(--card);
  border: 1px solid var(--border);
}

.project:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.15);
}
.project img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: all 0.4s ease;
  border-radius: 0;
}

.project:hover img {
  transform: scale(1.05);
}
.project .meta {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  background: linear-gradient(135deg, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.7));
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.project:hover .meta {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  transform: translateY(-2px);
}
.project .desc {
  position: absolute;
  right: 1rem;
  top: 1rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  padding: 0.5rem 0.875rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(2, 6, 23, 0.1);
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.1);
}

.project:hover .desc {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(2, 6, 23, 0.15);
}
[data-theme="dark"] .project {
  background: var(--card);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .project:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .project .meta {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15),
    rgba(255, 255, 255, 0.1)
  );
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .project:hover .meta {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
}

[data-theme="dark"] .project .desc {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .project:hover .desc {
  background: rgba(255, 255, 255, 0.15);
}
@media (max-width: 880px) {
  .project {
    min-width: 250px;
  }

  .project img {
    height: 180px;
  }

  .project .meta {
    left: 0.75rem;
    bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  .project .desc {
    right: 0.75rem;
    top: 0.75rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 520px) {
  .project {
    min-width: 200px;
  }

  .project img {
    height: 160px;
  }

  .project .meta {
    left: 0.5rem;
    bottom: 0.5rem;
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
  }

  .project .desc {
    right: 0.5rem;
    top: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }
}

/* services */
.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.service {
  padding: 0.875rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  min-height: 120px;
}
[data-theme="dark"] .service {
  background: linear-gradient(180deg, #0f172a, #0b1220);
}
@media (max-width: 880px) {
  .services {
    grid-template-columns: 1fr;
  }
}

/* about */
.about {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Responsive about split */
.about.card {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1rem;
  align-items: start;
}
.about-left {
  padding: 0.25rem 0.5rem;
}
.about-right {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Bio toggle */
#bioToggle {
  font-family: inherit;
  margin-top: 0.5rem;
  background: linear-gradient(90deg, var(--primary), #3aa0ff);
  color: #fff;
  border: none;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
}

#bioToggle[aria-expanded="true"] {
  background: linear-gradient(90deg, #40f16a, #3aa0ff);
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.stat {
  background: var(--card);
  padding: 0.5rem;
  border-radius: 10px;
  text-align: center;
  border: 1px solid var(--border);
}
.stat-num {
  font-weight: 800;
  color: var(--primary);
  font-size: 1.25rem;
}
.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Timeline */
.timeline {
  padding: 0.5rem;
  background: linear-gradient(
    180deg,
    rgba(11, 114, 255, 0.04),
    rgba(255, 122, 0, 0.02)
  );
  border-radius: 10px;
}
.timeline-item {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.25rem 0;
}
.timeline-item .dot {
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
}
.timeline-item .time {
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 880px) {
  .about.card {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 520px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Counter animation (subtle) */
.stat-num.animate {
  transition: transform 800ms cubic-bezier(0.22, 1, 0.36, 1);
  transform: translateY(-6px);
}

@media (prefers-reduced-motion: reduce) {
  .stat-num.animate {
    transition: none;
    transform: none;
  }
}

@font-face {
  font-family: lalezar;
  src: url("fonts/TTF/Lalezar-Regular.ttf") format("truetype"),
    url("fonts/OTF/Lalezar-Regular.otf") format("opentype");
}
@font-face {
  font-family: rokh;
  src: url("fonts/TTF/Rokh-Medium.ttf") format("truetype");
}

:root {
  --bg: #f6f7fb;
  --card: #fff;
  --text: #0f1724;
  --muted: #6b7280;
  --primary: #0b72ff;
  --accent: #ff7a00;
  --glass: rgba(158, 158, 158, 0.6);
  --radius: 14px;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --card: #101827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #3b82f6;
  --accent: #f59e0b;
  --glass: rgba(31, 41, 55, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}
body {
  font-family: lalezar, tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 1rem;
}
a {
  text-decoration: none;
  color: inherit;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

/* header */
header {
  position: relative;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  background: var(--bg);
}
.theme-toggle {
  border: none;
  background: var(--card);
  color: var(--text);
  padding: 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.08);
}
.theme-toggle:hover {
  background: linear-gradient(90deg, rgb(248, 244, 132), var(--accent));
  color: #fff;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo .mark {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  background-image: url("pictures/logo.png");
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  animation: floatLogo 6s ease-in-out infinite;
  transition: transform 0.25s ease, box-shadow 0.2s ease;
}

.logo .mark:hover {
  transform: translateY(-6px) scale(1.03) rotate(-1deg);
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.15);
}

@keyframes floatLogo {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-4px) rotate(-0.5deg);
  }
  50% {
    transform: translateY(0) rotate(0deg);
  }
  75% {
    transform: translateY(3px) rotate(0.5deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}
.brand {
  font-weight: 700;
  font-size: 1.125rem;
}
nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s ease;
}
nav a {
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.875rem;
  transition: all 0.3s ease;
}
nav a:hover,
.secondary:hover {
  background: linear-gradient(90deg, rgb(248, 244, 132), var(--accent));
  color: #fff;
}
.cta {
  background: linear-gradient(90deg, #40f16a, #3aa0ff);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(11, 114, 255, 0.12);
}
.cta:hover {
  background: linear-gradient(90deg, rgb(227, 182, 255), var(--accent));
}
.secondary {
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(90deg, var(--primary), #3aa0ff);
}
.nav-toggle {
  display: none;
  border: 0;
  background: transparent;
  font-size: 1.375rem;
  padding: 0.75rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.nav-toggle:hover {
  background: rgba(2, 6, 23, 0.08);
  transform: scale(1.05);
  color: var(--primary);
}

.nav-toggle:active {
  transform: scale(0.95);
}

.nav-toggle .menu-toggle {
  transition: all 0.3s ease;
}

.nav-toggle:hover .menu-toggle {
  transform: rotate(90deg);
}

/* Dark mode styles for nav-toggle */
[data-theme="dark"] .nav-toggle {
  color: var(--text);
}

[data-theme="dark"] .nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary);
}

@media (max-width: 880px) {
  nav {
    display: none;
    flex-direction: column;
    position: absolute;
    right: 0;
    top: 60px;
    background: var(--card);
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
    padding: 0.75rem;
    border-radius: 12px;
    width: 200px;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    animation: slideIn 0.3s ease;
  }

  nav.open {
    display: flex;
  }

  .nav-toggle {
    display: inline-flex;
  }

  /* Dark mode for mobile nav */
  [data-theme="dark"] nav {
    background: var(--card);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
  }
}

/* Ensure navbar logo displays fully on small screens */
@media (max-width: 520px) {
  .logo .mark {
    width: 44px;
    height: 44px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* hero */
.hero {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1.375rem;
  align-items: center;
  padding: 1.75rem 0;
}
/* Hero enhancements */
.hero h1 {
  font-size: 2rem;
  line-height: 1.15;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.typed-cursor {
  display: inline-block;
  color: var(--primary);
  font-weight: 700;
  animation: blink 1s steps(2, start) infinite;
  margin-left: 4px;
}
@keyframes blink {
  to {
    visibility: hidden;
  }
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.roles {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}
.role {
  background: linear-gradient(
    90deg,
    rgba(11, 114, 255, 0.12),
    rgba(255, 122, 0, 0.06)
  );
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
  color: var(--primary);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.role:not(:first-child) {
  display: none;
}
.hero-ctas {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.hero-ctas .cta {
  padding: 0.5rem 0.9rem;
}
.hero-ctas .secondary {
  padding: 0.45rem 0.85rem;
}
.hero-ctas .social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.06);
}
.hero-ctas .social i {
  font-size: 1rem;
}

/* CTA pulse */
.pulse {
  animation: ctaPulse 1.4s ease-in-out;
}
@keyframes ctaPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 6px 18px rgba(11, 114, 255, 0.12);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 14px 30px rgba(11, 114, 255, 0.18);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 6px 18px rgba(11, 114, 255, 0.12);
  }
}

/* Decorative floating blob behind mockup */
.visual {
  position: relative;
}
.visual::before {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 260px;
  height: 260px;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(11, 114, 255, 0.12),
    rgba(255, 122, 0, 0.06)
  );
  border-radius: 50%;
  filter: blur(20px);
  z-index: 0;
  transform: translateZ(0);
}
.mockup {
  position: relative;
  z-index: 1;
}

/* Scroll indicator */
.scroll-indicator {
  display: inline-flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  margin-left: 0.25rem;
}
.scroll-indicator .chev {
  transform: rotate(90deg);
  animation: floatDown 1.6s infinite;
}
@keyframes floatDown {
  0% {
    transform: translateY(0);
    opacity: 0.9;
  }
  50% {
    transform: translateY(6px);
    opacity: 0.6;
  }
  100% {
    transform: translateY(0);
    opacity: 0.9;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .typed-cursor,
  .mockup,
  .visual::before,
  .chev,
  .role {
    animation: none !important;
    transition: none !important;
  }
}
.hero .intro h1 {
  font-size: 1.875rem;
  margin-bottom: 0.75rem;
}
.hero .intro p {
  color: var(--muted);
  margin-bottom: 1rem;
}
.hero .actions {
  display: flex;
  gap: 0.75rem;
}
.hero .visual {
  background: linear-gradient(
    180deg,
    rgba(11, 114, 255, 0.07),
    rgba(255, 122, 0, 0.04)
  );
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
@keyframes float {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(2deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

.mockup {
  width: 100%;
  height: 320px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e6f0ff, #fff6ec);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(11, 114, 255, 0.06);
  transition: transform 0.3s ease;
  animation: float 4s ease-in-out infinite; /* اضافه کردن انیمیشن */
}

.mockup img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero .visual {
    order: -1;
  }
  .mockup {
    height: 220px;
  }
}

/* sections */
section {
  margin: 1.75rem 0;
  padding: 1rem;
  background: transparent;
}
.card {
  background: var(--card);
  padding: 0.875rem;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: var(--text);
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* portfolio slider */
.portfolio-slider {
  position: relative;
  display: flex;
  align-items: center;
}
.portfolio-slider .arrow {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  font-size: 1.2rem;
  padding: 0.75rem;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  margin: 0 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(2, 6, 23, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

.portfolio-slider .arrow:hover {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(2, 6, 23, 0.25);
}

.portfolio-slider .arrow:active {
  transform: scale(0.95);
}
.portfolio-slider .arrow.left {
  margin-right: 0.5rem;
}
.portfolio-slider .arrow.right {
  margin-left: 0.5rem;
}
.portfolio-slider .portfolio-grid {
  display: flex;
  gap: 1.25rem;
  overflow: hidden;
  scroll-behavior: smooth;
  flex: 1;
  padding: 0.5rem 0;
}
.project {
  min-width: 300px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s ease;
  box-shadow: 0 4px 20px rgba(2, 6, 23, 0.08);
  background: var(--card);
  border: 1px solid var(--border);
}

.project:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.15);
}
.project img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: all 0.4s ease;
  border-radius: 0;
}

.project:hover img {
  transform: scale(1.05);
}
.project .meta {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  background: linear-gradient(135deg, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.7));
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.project:hover .meta {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  transform: translateY(-2px);
}
.project .desc {
  position: absolute;
  right: 1rem;
  top: 1rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  padding: 0.5rem 0.875rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(2, 6, 23, 0.1);
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.1);
}

.project:hover .desc {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(2, 6, 23, 0.15);
}
[data-theme="dark"] .project {
  background: var(--card);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .project:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .project .meta {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15),
    rgba(255, 255, 255, 0.1)
  );
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .project:hover .meta {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
}

[data-theme="dark"] .project .desc {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .project:hover .desc {
  background: rgba(255, 255, 255, 0.15);
}
@media (max-width: 880px) {
  .project {
    min-width: 250px;
  }

  .project img {
    height: 180px;
  }

  .project .meta {
    left: 0.75rem;
    bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  .project .desc {
    right: 0.75rem;
    top: 0.75rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 520px) {
  .project {
    min-width: 200px;
  }

  .project img {
    height: 160px;
  }

  .project .meta {
    left: 0.5rem;
    bottom: 0.5rem;
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
  }

  .project .desc {
    right: 0.5rem;
    top: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }
}

/* services */
.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.service {
  padding: 0.875rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  min-height: 120px;
}
[data-theme="dark"] .service {
  background: linear-gradient(180deg, #0f172a, #0b1220);
}
@media (max-width: 880px) {
  .services {
    grid-template-columns: 1fr;
  }
}

/* about */
.about {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* skills */
.skills {
  margin-top: 0.75rem;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.skill {
  position: relative;
  padding: 1rem;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  cursor: pointer;
  overflow: hidden;
}

.skill::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.6s ease;
}

.skill:hover::before {
  left: 100%;
}

.skill:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--primary);
}

[data-theme="dark"] .skill:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.skill .skill-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.375rem;
  position: relative;
  z-index: 2;
}
.skill .icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #3aa0ff);
  color: #fff;
  font-size: 16px;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.skill .icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.skill:hover .icon::before {
  width: 100%;
  height: 100%;
}

.skill .name {
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.skill:hover .name {
  color: var(--primary);
  transform: translateX(4px);
}

.skill .percent {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}
.progress {
  width: 100%;
  background: rgba(15, 23, 36, 0.08);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .progress {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress .bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #40f16a, #3aa0ff, #9333ea);
  border-radius: 999px;
  box-shadow: 0 0 0 rgba(59, 130, 246, 0);
  transition: width 1200ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 600ms ease;
  position: relative;
  overflow: hidden;
}

.progress .bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.skill:hover .progress .bar::before {
  opacity: 1;
}

/* Glow + Shine when animated */
.skill.animated .progress .bar {
  width: var(--val);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.35),
    0 0 20px rgba(64, 241, 106, 0.25);
}

.skill .progress .bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  left: -70px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.8),
    rgba(255, 255, 255, 0.4),
    rgba(255, 255, 255, 0)
  );
  filter: blur(1px);
  transform: skewX(-15deg);
  border-radius: 50%;
}

.skill.animated .progress .bar::after {
  animation: shine 3s linear 0.5s infinite;
}

@keyframes shine {
  0% {
    left: -70px;
    opacity: 0;
    transform: skewX(-15deg) scaleY(0.5);
  }
  15% {
    opacity: 1;
    transform: skewX(-15deg) scaleY(1);
  }
  85% {
    opacity: 1;
    transform: skewX(-15deg) scaleY(1);
  }
  100% {
    left: calc(100% + 70px);
    opacity: 0;
    transform: skewX(-15deg) scaleY(0.5);
  }
}

/* Subtle glow pulsing while visible */
@keyframes glowPulse {
  0% {
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.2),
      0 0 10px rgba(64, 241, 106, 0.1);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.4),
      0 0 16px rgba(64, 241, 106, 0.2);
    filter: brightness(1.1);
  }
  100% {
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.2),
      0 0 10px rgba(64, 241, 106, 0.1);
    filter: brightness(1);
  }
}

.skill.animated .progress .bar {
  animation: glowPulse 3s ease-in-out 1s infinite;
}

/* انیمیشن اضافی برای آیکون‌ها */
@keyframes iconBounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(-8px) scale(1.05);
  }
  60% {
    transform: translateY(-4px) scale(1.02);
  }
}

.skill.animated .icon {
  animation: iconBounce 1.5s ease-in-out 0.3s;
}

/* انیمیشن loading برای مهارت‌هایی که هنوز انیمیت نشده‌اند */
.skill:not(.animated) {
  opacity: 0.7;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.skill:not(.animated) .progress .bar {
  background: linear-gradient(90deg, #e5e7eb, #d1d5db);
}

[data-theme="dark"] .skill:not(.animated) .progress .bar {
  background: linear-gradient(90deg, #374151, #4b5563);
}

/* انیمیشن pulse برای مهارت‌های در حال loading */
@keyframes loadingPulse {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

.skill:not(.animated) {
  animation: loadingPulse 2s ease-in-out infinite;
}
@media (max-width: 520px) {
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .skill {
    padding: 0.75rem;
  }

  .skill .icon {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .skill .name {
    font-size: 0.9rem;
  }

  .skill .percent {
    font-size: 0.8rem;
  }

  .progress {
    height: 10px;
  }
}
[data-theme="dark"] .progress {
  background: rgba(255, 255, 255, 0.12);
}

/* Percentage count-up style boost when animated */
.skill .percent {
  transition: color 300ms ease, transform 300ms ease;
}
.skill.animated .percent {
  color: var(--primary);
  transform: translateY(-2px);
}

/* process */
#process .process {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.step {
  position: relative;
}
.step-num {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--primary), #3aa0ff);
  color: #fff;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  box-shadow: 0 6px 12px rgba(2, 6, 23, 0.12);
}
@media (max-width: 880px) {
  #process .process {
    grid-template-columns: 1fr;
  }
}

/* testimonials */
.testimonials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.testimonial .quote {
  color: var(--text);
}
.testimonial .author {
  color: var(--muted);
  margin-top: 0.375rem;
  font-size: 0.875rem;
}
@media (max-width: 880px) {
  .testimonials {
    grid-template-columns: 1fr;
  }
}

/* FAQ */
.faq {
  display: grid;
  gap: 0.5rem;
}
.faq-q {
  width: 100%;
  text-align: right;
  background: transparent;
  border: none;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  cursor: pointer;
}
.faq-a {
  color: var(--muted);
  margin-top: 0.5rem;
}

/* contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1rem;
}
.contact-grid form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
input,
textarea {
  font-family: rokh;
  padding: 0.625rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 36, 0.06);
  font-size: 0.875rem;
  background: var(--card);
  color: var(--text);
}
input::placeholder,
textarea::placeholder {
  color: #28292a;
}
[data-theme="dark"] input,
[data-theme="dark"] textarea {
  border: 1px solid rgba(255, 255, 255, 0.14);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #9ca3af;
}
textarea {
  min-height: 120px;
}
.btn-send {
  font-family: lalezar, tahoma, sans-serif;
  background: linear-gradient(90deg, var(--primary), #3aa0ff);
  color: white;
  padding: 0.625rem;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-send:hover {
  background: linear-gradient(90deg, rgb(248, 244, 132), var(--accent));
}

@media (max-width: 880px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* footer */
footer {
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
footer i {
  transition: transform 0.3s ease, color 0.3s ease;
}
footer .tlg:hover i {
  color: #4e96fa;
  transform: scale(1.5);
}
footer .wts:hover i {
  color: #40f16a;
  transform: scale(1.5);
}
footer .link:hover i {
  color: #233bee;
  transform: scale(1.5);
}

/* Footer extended */
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 1rem;
  align-items: start;
}
.footer-col .footer-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.footer-links {
  list-style: none;
  display: grid;
  gap: 0.375rem;
}
.footer-links a {
  color: var(--muted);
}
.footer-links a:hover {
  color: var(--text);
}
.socials {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.newsletter {
  display: flex;
  gap: 0.5rem;
}
.newsletter input[type="email"] {
  flex: 1;
}
.newsletter button {
  background: linear-gradient(90deg, var(--primary), #3aa0ff);
  color: #fff;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
}
.newsletter button:hover {
  background: linear-gradient(90deg, rgb(248, 244, 132), var(--accent));
}
.footer-contact {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  margin-top: 0.5rem;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  padding-top: 0.75rem;
}
.badges {
  display: flex;
  gap: 0.375rem;
}
.badge {
  background: #eef2ff;
  color: #3b82f6;
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}
@media (max-width: 880px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 520px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Modal پروژه با بلور پس‌زمینه */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.4);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 9999; /* مطمئن شو Modal بالاتر از همه است */
}

.modal.open {
  display: flex;
  opacity: 1;
}
.modal .panel {
  background: var(--card);
  max-width: 600px;
  width: 90%;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(-20px);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  position: relative;
}
.modal.open .panel {
  transform: translateY(0);
  opacity: 1;
}
.tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.tag {
  background: var(--primary);
  color: #fff;
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
}
/* دکمه بستن در گوشه بالا */
.modal-close-btn {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(0, 0, 0, 0.1);
  color: var(--text);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.3s ease;
  z-index: 10;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  transform: scale(1.1);
}

[data-theme="dark"] .modal-close-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

[data-theme="dark"] .modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* دکمه بستن متنی */
.modal-close-text-btn {
  margin-top: 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: lalezar, tahoma, sans-serif;
  transition: all 0.3s ease;
}

.modal-close-text-btn:hover {
  background: var(--primary);
  transform: translateY(-2px);
}

.con div a {
  transition: all 0.3s ease;
}

.con a:hover {
  color: #ff7a00;
}

/* Contact card (con) enhancements */
.con {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--card), rgba(11, 114, 255, 0.03));
  border: 1px solid rgba(2, 6, 23, 0.06);
}
[data-theme="dark"] .con {
  background: linear-gradient(180deg, var(--card), rgba(59, 130, 246, 0.06));
  border-color: rgba(255, 255, 255, 0.12);
}
.con > div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(2, 6, 23, 0.03);
  padding: 0.5rem 0.625rem;
  border-radius: 10px;
}
[data-theme="dark"] .con > div {
  background: rgba(255, 255, 255, 0.04);
}
.con i {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #3aa0ff);
  color: #fff;
}
.con a {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.04);
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
[data-theme="dark"] .con a {
  background: rgba(255, 255, 255, 0.06);
}

/* Back to top */
#backToTop {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgb(88, 22, 241);
  color: #fff;
  padding: 0.75rem;
  border-radius: 50%;
  display: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(105, 11, 255, 0.511);
  transition: all 0.5s ease;
  border: none;
}
#backToTop:hover {
  background: blueviolet;
}

/* Toasts */
#toastContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10000;
  pointer-events: none;
}
.toast {
  min-width: 260px;
  max-width: 360px;
  background: #111827;
  color: #fff;
  border-radius: 12px;
  padding: 0.75rem 0.875rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(-10px);
  opacity: 0;
  animation: toast-in 300ms ease forwards;
  pointer-events: auto;
}
.toast.success {
  background: linear-gradient(135deg, #10b981, #0ea5e9);
}
.toast.error {
  background: linear-gradient(135deg, #ef4444, #f59e0b);
}
.toast .icon {
  font-size: 1rem;
}
.toast .message {
  flex: 1;
  font-size: 0.9rem;
}
.toast .close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
}
@keyframes toast-in {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes toast-out {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-10px);
    opacity: 0;
  }
}

/* process */
#process .process {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.step {
  position: relative;
}
.step-num {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--primary), #3aa0ff);
  color: #fff;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  box-shadow: 0 6px 12px rgba(2, 6, 23, 0.12);
}
@media (max-width: 880px) {
  #process .process {
    grid-template-columns: 1fr;
  }
}

/* testimonials */
.testimonials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.testimonial .quote {
  color: var(--text);
}
.testimonial .author {
  color: var(--muted);
  margin-top: 0.375rem;
  font-size: 0.875rem;
}
@media (max-width: 880px) {
  .testimonials {
    grid-template-columns: 1fr;
  }
}

/* FAQ */
.faq {
  display: grid;
  gap: 0.5rem;
}
.faq-q {
  width: 100%;
  text-align: right;
  background: transparent;
  border: none;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  cursor: pointer;
}
.faq-a {
  color: var(--muted);
  margin-top: 0.5rem;
}

/* contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1rem;
}
.contact-grid form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
input,
textarea {
  font-family: rokh;
  padding: 0.625rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 36, 0.06);
  font-size: 0.875rem;
  background: var(--card);
  color: var(--text);
}
input::placeholder,
textarea::placeholder {
  color: #28292a;
}
[data-theme="dark"] input,
[data-theme="dark"] textarea {
  border: 1px solid rgba(255, 255, 255, 0.14);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #9ca3af;
}
textarea {
  min-height: 120px;
}
.btn-send {
  font-family: lalezar, tahoma, sans-serif;
  background: linear-gradient(90deg, var(--primary), #3aa0ff);
  color: white;
  padding: 0.625rem;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-send:hover {
  background: linear-gradient(90deg, rgb(248, 244, 132), var(--accent));
}

@media (max-width: 880px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
  /* Prevent overflow of long links in contact card */
  .con {
    overflow-wrap: anywhere;
    word-wrap: break-word;
  }
}

/* footer */
footer {
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
footer i {
  transition: transform 0.3s ease, color 0.3s ease;
}
footer .tlg:hover i {
  color: #4e96fa;
  transform: scale(1.5);
}
footer .wts:hover i {
  color: #40f16a;
  transform: scale(1.5);
}
footer .link:hover i {
  color: #233bee;
  transform: scale(1.5);
}

/* Footer extended */
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 1rem;
  align-items: start;
}
.footer-col .footer-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.footer-links {
  list-style: none;
  display: grid;
  gap: 0.375rem;
}
.footer-links a {
  color: var(--muted);
}
.footer-links a:hover {
  color: var(--text);
}
.socials {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.newsletter {
  display: flex;
  gap: 0.5rem;
}
.newsletter input[type="email"] {
  flex: 1;
}
.newsletter button {
  background: linear-gradient(90deg, var(--primary), #3aa0ff);
  color: #fff;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
}
.newsletter button:hover {
  background: linear-gradient(90deg, rgb(248, 244, 132), var(--accent));
}
.footer-contact {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  margin-top: 0.5rem;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  padding-top: 0.75rem;
}
.badges {
  display: flex;
  gap: 0.375rem;
}
.badge {
  background: #eef2ff;
  color: #3b82f6;
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}
@media (max-width: 880px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 520px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Modal پروژه با بلور پس‌زمینه */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.4);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 9999; /* مطمئن شو Modal بالاتر از همه است */
}

.modal.open {
  display: flex;
  opacity: 1;
}
.modal .panel {
  background: var(--card);
  max-width: 600px;
  width: 90%;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(-20px);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  position: relative;
}
.modal.open .panel {
  transform: translateY(0);
  opacity: 1;
}
.tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.tag {
  background: var(--primary);
  color: #fff;
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8125rem;
}
/* دکمه بستن در گوشه بالا */
.modal-close-btn {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(0, 0, 0, 0.1);
  color: var(--text);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.3s ease;
  z-index: 10;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  transform: scale(1.1);
}

[data-theme="dark"] .modal-close-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

[data-theme="dark"] .modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* دکمه بستن متنی */
.modal-close-text-btn {
  margin-top: 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: lalezar, tahoma, sans-serif;
  transition: all 0.3s ease;
}

.modal-close-text-btn:hover {
  background: var(--primary);
  transform: translateY(-2px);
}

.con div a {
  transition: all 0.3s ease;
}

.con a:hover {
  color: #ff7a00;
}

/* Back to top */
#backToTop {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgb(88, 22, 241);
  color: #fff;
  padding: 0.75rem;
  border-radius: 50%;
  display: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(105, 11, 255, 0.511);
  transition: all 0.5s ease;
  border: none;
}
#backToTop:hover {
  background: blueviolet;
}

/* Toasts */
#toastContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10000;
  pointer-events: none;
}
.toast {
  min-width: 260px;
  max-width: 360px;
  background: #111827;
  color: #fff;
  border-radius: 12px;
  padding: 0.75rem 0.875rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(-10px);
  opacity: 0;
  animation: toast-in 300ms ease forwards;
  pointer-events: auto;
}
.toast.success {
  background: linear-gradient(135deg, #10b981, #0ea5e9);
}
.toast.error {
  background: linear-gradient(135deg, #ef4444, #f59e0b);
}
.toast .icon {
  font-size: 1rem;
}
.toast .message {
  flex: 1;
  font-size: 0.9rem;
}
.toast .close {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
}
@keyframes toast-in {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes toast-out {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-10px);
    opacity: 0;
  }
}
/* Comments Section */
.comments-section {
  padding: 4rem 0;
  background: var(--bg);
}

.comments-form-container {
  background: var(--card);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 3rem;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.loading-comments {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
  font-size: 14px;
}

.comment-item {
  background: var(--card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border);
  position: relative;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 16px;
}

.comment-info {
  flex: 1;
}

.comment-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.comment-date {
  font-size: 12px;
  color: var(--muted);
}

.comment-text {
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.comment-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.comment-reply-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.comment-reply-btn:hover {
  background: rgba(59, 130, 246, 0.1);
}

.comment-replies {
  margin-top: 1rem;
  padding-left: 2rem;
  border-left: 2px solid var(--border);
}

.reply-form {
  background: var(--bg);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  display: none;
}

.reply-form.active {
  display: block;
}

.reply-form textarea {
  width: 100%;
  min-height: 80px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  margin-bottom: 0.5rem;
}

.reply-form .btn-send {
  padding: 6px 12px;
  font-size: 12px;
}

.admin-reply {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.1),
    rgba(147, 51, 234, 0.1)
  );
  border-left-color: var(--primary);
}

.admin-reply .comment-avatar {
  background: linear-gradient(135deg, #10b981, #059669);
}

.admin-reply .comment-name::after {
  content: " (مدیر)";
  color: var(--primary);
  font-size: 11px;
  font-weight: 500;
}

/* Dark mode for comments */
[data-theme="dark"] .comments-form-container {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group textarea:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .reply-form textarea {
  background: var(--card);
  border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .comment-replies {
  border-left-color: rgba(255, 255, 255, 0.14);
}

/* Responsive comments */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .comment-replies {
    padding-left: 1rem;
  }

  .comments-form-container {
    padding: 1.5rem;
  }
}

/* Comments list scrollable */
.comments-list {
  max-height: 420px;
  overflow: auto;
  padding-right: 6px;
}

/* Nice scrollbar for comments */
.comments-list::-webkit-scrollbar {
  width: 8px;
}
.comments-list::-webkit-scrollbar-track {
  background: rgba(2, 6, 23, 0.06);
  border-radius: 8px;
}
.comments-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), #3aa0ff);
  border-radius: 8px;
}
[data-theme="dark"] .comments-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

/* Replies indentation */
.comment-replies {
  margin-top: 1rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--border);
}

/* Nested replies styling */
.reply-level-0 {
  margin-left: 0;
}
.reply-level-1 {
  margin-left: 1rem;
  background: rgba(2, 6, 23, 0.02);
}
.reply-level-2 {
  margin-left: 2rem;
  background: rgba(2, 6, 23, 0.04);
}
.reply-level-3 {
  margin-left: 3rem;
  background: rgba(2, 6, 23, 0.06);
}

[data-theme="dark"] .reply-level-1 {
  background: rgba(255, 255, 255, 0.02);
}
[data-theme="dark"] .reply-level-2 {
  background: rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] .reply-level-3 {
  background: rgba(255, 255, 255, 0.06);
}

/* Limit nesting depth */
.reply-level-3 .comment-reply-btn {
  display: none;
}

/* Mobile navigation links styling */
@media (max-width: 880px) {
  nav a {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin: 0.25rem 0;
    text-decoration: none;
    color: var(--text);
    display: block;
  }

  nav a:hover {
    background: rgba(2, 6, 23, 0.08);
    color: var(--primary);
    transform: translateX(4px);
  }

  [data-theme="dark"] nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
  }
}

/* Menu icon animation when toggling */
.nav-toggle .fa-bars {
  transition: all 0.3s ease;
  transform-origin: center;
}

.nav-toggle .fa-times {
  transition: all 0.3s ease;
  transform: rotate(180deg);
  transform-origin: center;
}

/* Active state for menu toggle */
.nav-toggle.active {
  background: rgba(2, 6, 23, 0.12);
  color: var(--primary);
}

[data-theme="dark"] .nav-toggle.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--primary);
}

/* Inline replies inside the same comment card */
.comment-item .comment-replies {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
  padding-left: 0;
  border-left: 0;
  display: grid;
  gap: 0.75rem;
}
.comment-item .comment-replies .comment-item {
  background: rgba(2, 6, 23, 0.03);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: 10px;
}
[data-theme="dark"] .comment-item .comment-replies .comment-item {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
}
.comment-item .comment-replies .comment-header {
  margin-bottom: 0.5rem;
}
.comment-item .comment-replies .comment-avatar {
  width: 32px;
  height: 32px;
  font-size: 14px;
}
.comment-item .comment-replies .comment-text {
  margin-bottom: 0;
}
