@import url('https://cdn.fontcdn.ir/Font/Persian/Shabnam/Shabnam.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #1d4ed8;
  --blue-light: #3b82f6;
  --blue-pale: #dbeafe;
  --dark: #0f172a;
  --text: #1e293b;
  --text-muted: #64748b;
  --bg: #f8fafc;
  --white: #ffffff;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-sm: 8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Shabnam', 'Tahoma', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0; right: 0; left: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav .logo {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav ul a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

nav ul a:hover { color: #fff; }

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: var(--dark);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 50%, rgba(59,130,246,0.25) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 30%, rgba(29,78,216,0.3) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 60% 80%, rgba(99,102,241,0.15) 0%, transparent 50%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.9s ease forwards 0.2s;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.hero-badge {
  display: inline-block;
  background: rgba(59,130,246,0.2);
  border: 1px solid rgba(59,130,246,0.4);
  color: #93c5fd;
  font-size: 0.85rem;
  padding: 0.35rem 1rem;
  border-radius: 99px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  color: #fff;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero h1 span {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 2.5rem;
  max-width: 500px;
  margin-right: auto;
  margin-left: auto;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  padding: 0.75rem 2rem;
  border-radius: 99px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
  border: none;
  cursor: pointer;
  display: inline-block;
}

.btn-primary:hover { background: #1e40af; transform: translateY(-2px); }

.btn-outline {
  background: transparent;
  color: rgba(255,255,255,0.8);
  padding: 0.75rem 2rem;
  border-radius: 99px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.25);
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
  cursor: pointer;
  display: inline-block;
}

.btn-outline:hover { border-color: rgba(255,255,255,0.6); color: #fff; transform: translateY(-2px); }

/* ===== SECTIONS ===== */
section { padding: 5rem 1.5rem; }

.container { max-width: 960px; margin: 0 auto; }

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--blue-light);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 1rem;
  line-height: 1.25;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 3rem;
}

/* ===== ABOUT ===== */
#about { background: var(--white); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

@media (max-width: 680px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.about-visual {
  position: relative;
}

.about-avatar {
  width: 220px;
  height: 220px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--dark) 0%, #1e3a8a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  margin: 0 auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(29,78,216,0.3);
}

.about-avatar::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 28px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  z-index: -1;
}

.stats-row {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  justify-content: center;
}

.stat-item {
  text-align: center;
}

.stat-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue);
  display: block;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.about-text p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.tag {
  background: var(--blue-pale);
  color: var(--blue);
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  font-weight: 600;
}

/* ===== SKILLS ===== */
#skills { background: var(--bg); }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
  cursor: default;
}

.skill-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(29,78,216,0.12);
  border-color: var(--blue-light);
}

.skill-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--blue-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
}

.skill-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.skill-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.skill-bar-wrap {
  margin-top: 1rem;
  background: var(--border);
  border-radius: 99px;
  height: 5px;
  overflow: hidden;
}

.skill-bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--blue), #60a5fa);
  transition: width 1s ease;
}

/* ===== PROJECTS ===== */
#projects { background: var(--dark); }

#projects .section-title { color: var(--white); }
#projects .section-label { color: #60a5fa; }
#projects .section-desc { color: rgba(255,255,255,0.5); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s;
}

.project-card:hover {
  transform: translateY(-6px);
  background: rgba(255,255,255,0.09);
  border-color: rgba(59,130,246,0.4);
}

.project-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  background: rgba(59,130,246,0.2);
  color: #93c5fd;
  border: 1px solid rgba(59,130,246,0.3);
  margin-bottom: 1rem;
  font-weight: 600;
}

.project-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.6rem;
}

.project-card p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.65;
}

/* ===== CONTACT ===== */
#contact { background: var(--white); }

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
  align-items: start;
}

@media (max-width: 680px) {
  .contact-layout { grid-template-columns: 1fr; gap: 2rem; }
}

.contact-info h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.75rem;
}

.contact-info p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.contact-link:hover {
  border-color: var(--blue-light);
  color: var(--blue);
  background: var(--blue-pale);
}

.contact-link-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--blue-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ===== FORM ===== */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Shabnam', 'Tahoma', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.form-group textarea { resize: vertical; min-height: 130px; }

.form-submit {
  width: 100%;
  padding: 0.85rem;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Shabnam', 'Tahoma', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.form-submit:hover { background: #1e40af; transform: translateY(-1px); }
.form-submit:active { transform: translateY(0); }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--dark);
  color: #fff;
  padding: 0.85rem 1.75rem;
  border-radius: 99px;
  font-size: 0.95rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  opacity: 0;
  z-index: 999;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== FOOTER ===== */
footer {
  background: var(--dark);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 0.875rem;
}

footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

footer a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover { color: #fff; }

/* ===== ANIMATIONS ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

@media (max-width: 480px) {
  nav ul { display: none; }
  .hero h1 { font-size: 2rem; }
}