/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0b0f19;
  --bg-card: #121826;
  --bg-card-hover: #1a2234;
  --text: #e8ecf4;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-light: #818cf8;
  --accent: #22d3ee;
  --gradient: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: "Vazirmatn", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.navbar.scrolled {
  border-bottom-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 70% 20%, rgba(99, 102, 241, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(34, 211, 238, 0.1), transparent);
  pointer-events: none;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-tag {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.2rem;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1.2rem;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.8rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}

.btn-outline:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.08);
}

.btn-full {
  width: 100%;
}

/* Code window */
.code-window {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transform: perspective(1000px) rotateY(-6deg) rotateX(2deg);
  transition: var(--transition);
}

.code-window:hover {
  transform: perspective(1000px) rotateY(0) rotateX(0);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.9rem 1.1rem;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.code-title {
  margin-right: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.code-body {
  padding: 1.4rem 1.5rem;
  font-family: "Fira Code", "Consolas", monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  direction: ltr;
  text-align: left;
  overflow-x: auto;
}

.code-body .kw { color: #c792ea; }
.code-body .fn { color: #82aaff; }
.code-body .str { color: #c3e88d; }

/* ===== Sections common ===== */
section {
  padding: 6rem 0;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background: var(--gradient);
  border-radius: 2px;
  margin: 0.8rem auto 0;
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  align-items: center;
}

.about-image img {
  width: 100%;
  max-width: 280px;
  border-radius: 20px;
  border: 3px solid rgba(99, 102, 241, 0.5);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.25);
  object-fit: cover;
  aspect-ratio: 1;
}

.about-content .about-card {
  text-align: right;
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .about-image {
    display: flex;
    justify-content: center;
  }
  .about-content .about-card {
    text-align: center;
  }
}

.about-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
  text-align: center;
}

.about-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
}

.about-icon {
  font-size: 2.4rem;
  margin-bottom: 1rem;
}

.about-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.about-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== Skills ===== */
.skills {
  background: linear-gradient(180deg, transparent, rgba(99, 102, 241, 0.04), transparent);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
}

.skill-item {
  background: var(--bg-card);
  padding: 1.2rem 1.4rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.skill-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  font-weight: 500;
  font-size: 0.95rem;
}

.skill-info span:last-child {
  color: var(--primary-light);
}

.skill-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0;
  background: var(--gradient);
  border-radius: 4px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-fill.animate {
  width: var(--width);
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.8rem;
}

.project-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  border-color: rgba(99, 102, 241, 0.3);
}

.project-image {
  height: 160px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 1rem;
  position: relative;
}

.project-image.net-speedo {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f766e 100%);
}

.project-image.portfolio {
  background: linear-gradient(135deg, #312e81 0%, #4c1d95 100%);
}

.project-image.soon {
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
}

.project-badge {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-content h3 {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
}

.project-content p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1rem;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.project-tags span {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  padding: 0.25rem 0.7rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}

.project-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.project-link:hover {
  color: var(--primary-light);
}

.coming-soon {
  opacity: 0.85;
}

/* ===== Contact ===== */
.contact-desc {
  text-align: center;
  color: var(--text-muted);
  max-width: 500px;
  margin: -1.5rem auto 2.5rem;
}

.contact-card {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group {
  margin-bottom: 1.3rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  justify-content: center;
}

.info-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.info-icon {
  font-size: 1.5rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.15);
  border-radius: 12px;
  flex-shrink: 0;
}

.info-item strong {
  display: block;
  margin-bottom: 0.2rem;
}

.info-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.info-item a {
  color: var(--accent);
}

.info-item a:hover {
  text-decoration: underline;
}

/* ===== Footer ===== */
.footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-desc {
    margin-inline: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .code-window {
    transform: none;
    max-width: 420px;
    margin-inline: auto;
  }

  .contact-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 280px;
    height: 100vh;
    background: var(--bg-card);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    transition: right 0.35s ease;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
  }

  .nav-links.open {
    right: 0;
  }

  .menu-toggle {
    display: flex;
    z-index: 1001;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

@media (max-width: 480px) {
  section {
    padding: 4rem 0;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .contact-card {
    padding: 1.5rem;
  }
}


/* Skill icons */
.skill-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.skill-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Contact real icons */
.info-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}
.info-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}


.contact-card-only {
  max-width: 520px;
  margin-inline: auto;
  display: block !important;
}
.contact-card-only .contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
