:root {
  --primary: #0d6efd;
  --dark: #0f172a;
  --darker: #0a0f1e;
  --light: #f8fafc;
  --gray: #64748b;
  --border: #e2e8f0;
  --accent: #06b6d4;
  --container: 1100px;
  --radius: 16px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--light); color: var(--dark); line-height: 1.8;
  overflow-x: hidden; width: 100%; max-width: 100vw;
}
img, svg, video, canvas { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, h4, h5, h6, li, span, div { overflow-wrap: anywhere; word-break: break-word; }

/* NAV */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(255,255,255,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav-inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; padding-block: .85rem; padding-inline: clamp(1rem, 4vw, 2rem); max-width: var(--container); margin-inline: auto; }
.logo { justify-self: start; font-weight: 800; font-size: clamp(1rem, 2.5vw, 1.2rem); color: var(--primary); display: flex; align-items: center; gap: 0.5rem; }
.logo img { width: 36px; height: 36px; transition: transform 0.3s ease; }
.logo:hover img { transform: rotate(15deg) scale(1.1); }
.nav-links { justify-self: center; display: flex; gap: clamp(1rem, 2.5vw, 1.5rem); list-style: none; }
.nav-links a { font-weight: 500; color: var(--dark); transition: color .2s; font-size: clamp(.85rem, 2vw, 1rem); }
.nav-links a:hover { color: var(--primary); }
.nav-actions { justify-self: end; display: flex; align-items: center; gap: .75rem; }
.lang-switch { border: 1px solid var(--border); padding: .3rem .8rem; border-radius: 8px; font-weight: 600; font-size: .85rem; transition: all .2s; }
.lang-switch:hover { border-color: var(--primary); color: var(--primary); }
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* HERO */
.hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; justify-content: center; padding-block: clamp(6rem, 12vw, 8rem) clamp(3rem, 8vw, 5rem); padding-inline: clamp(1rem, 5vw, 2rem); background: linear-gradient(135deg, var(--darker) 0%, #1e293b 100%); color: white; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle at 20% 40%, rgba(13,110,253,.25), transparent 50%), radial-gradient(circle at 80% 60%, rgba(6,182,212,.20), transparent 50%); }
.hero-content { position: relative; z-index: 1; max-width: 850px; width: 100%; }
.badge { display: inline-block; background: rgba(13,110,253,.15); border: 1px solid rgba(13,110,253,.4); color: #93c5fd; padding: .35rem 1rem; border-radius: 999px; font-size: clamp(.75rem, 2vw, .9rem); margin-bottom: 1.5rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 3.2rem); font-weight: 800; margin-bottom: 1rem; line-height: 1.3; text-wrap: balance; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: clamp(.95rem, 2.5vw, 1.15rem); color: #cbd5e1; max-width: 700px; margin-inline: auto; margin-bottom: 2rem; }
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .8rem 1.6rem; border-radius: 10px; font-weight: 600; font-family: inherit; font-size: clamp(.9rem, 2vw, 1rem); border: none; cursor: pointer; transition: all .2s; text-align: center; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(13,110,253,.4); }
.btn-outline { border: 1px solid rgba(255,255,255,.5); color: white; background: transparent; backdrop-filter: blur(4px); }
.btn-outline:hover { background: rgba(255,255,255,.15); border-color: white; }

/* SECTIONS */
section { width: 100%; max-width: var(--container); margin-inline: auto; padding-block: clamp(3rem, 8vw, 5rem); padding-inline: clamp(1rem, 4vw, 2rem); }
.section-title { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; margin-bottom: .5rem; text-align: center; line-height: 1.3; }
.section-sub { text-align: center; color: var(--gray); margin-bottom: clamp(2rem, 5vw, 3rem); font-size: clamp(.9rem, 2vw, 1rem); }

/* ABOUT */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.about-text h2 { font-size: clamp(1.4rem, 3.5vw, 1.8rem); margin-bottom: 1rem; line-height: 1.3; }
.about-text p { color: var(--gray); margin-bottom: 1rem; font-size: clamp(.9rem, 2vw, 1rem); text-align: justify; }
.about-stats { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.stat { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem 1rem; text-align: center; box-shadow: 0 4px 15px rgba(0,0,0,.03); }
.stat-num { display: block; font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; color: var(--primary); line-height: 1.2; }
.stat-label { color: var(--gray); font-size: clamp(.8rem, 2vw, .9rem); }

/* SERVICES & TECH & PROCESS */
.services-grid, .tech-grid, .process-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(1rem, 3vw, 1.5rem); }
.card, .tech-card, .process-step { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.25rem, 4vw, 2rem) clamp(1rem, 3vw, 1.5rem); transition: transform .25s, box-shadow .25s, border-color .25s; min-width: 0; display: flex; flex-direction: column; }
.card:hover, .tech-card:hover, .process-step:hover { transform: translateY(-6px); border-color: var(--primary); box-shadow: 0 15px 40px rgba(13,110,253,.12); }
.card .icon { width: 56px; height: 56px; background: rgba(13,110,253,.1); color: var(--primary); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; margin-bottom: 1rem; }
.card h3, .tech-card h3, .process-step h3 { font-size: clamp(1rem, 2.5vw, 1.15rem); margin-bottom: .5rem; line-height: 1.4; color: var(--dark); }
.card p, .tech-card p, .process-step p { color: var(--gray); font-size: clamp(.85rem, 2vw, .95rem); margin: 0; }
.tech-card { text-align: center; justify-content: center; min-height: 140px; }
.tech-card h3 { color: var(--primary); }
.process-step { text-align: center; align-items: center; }
.step-num { width: 50px; height: 50px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.4rem; margin-bottom: 1.25rem; box-shadow: 0 4px 10px rgba(13,110,253,0.3); }

/* CLIENTS */
.clients-box { margin-top: clamp(2rem, 5vw, 3rem); background: white; border: 1px solid var(--border); border-radius: 20px; padding: clamp(1.5rem, 5vw, 2.5rem) clamp(1rem, 4vw, 2rem); }
.clients-box h3 { font-size: clamp(1.15rem, 3vw, 1.4rem); margin-bottom: .5rem; text-align: center; line-height: 1.3; }
.clients-box > p { text-align: center; color: var(--gray); margin-bottom: clamp(1.25rem, 3vw, 2rem); font-size: clamp(.85rem, 2vw, 1rem); }
.clients-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.client-item { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem; background: var(--light); border-radius: 12px; font-size: clamp(.85rem, 2vw, .95rem); transition: background .2s, transform .2s; }
.client-item:hover { background: rgba(13,110,253,.08); transform: translateX(-4px); }
body.en .client-item:hover { transform: translateX(4px); }
.client-item i { color: var(--primary); font-size: 1.3rem; flex-shrink: 0; }

/* CONTACT */
.contact-box { background: var(--dark); color: white; border-radius: 24px; padding: clamp(1.5rem, 5vw, 3rem) clamp(1rem, 4vw, 2rem); max-width: 700px; margin-inline: auto; }
.contact-box h2 { font-size: clamp(1.4rem, 4vw, 2rem); margin-bottom: .5rem; text-align: center; line-height: 1.3; }
.contact-box > p { color: #94a3b8; margin-bottom: 2rem; text-align: center; font-size: clamp(.9rem, 2vw, 1rem); }
.contact-email-card { display: flex; align-items: center; justify-content: center; gap: 1rem; background: #1e293b; border: 1px solid #334155; padding: 1.5rem; border-radius: 12px; font-size: clamp(1.2rem, 4vw, 1.5rem); font-weight: 600; margin-top: 1.5rem; transition: border-color .2s, transform .2s; direction: ltr; }
.contact-email-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.contact-email-card i { color: var(--accent); }
.contact-email-card a { color: white; }

/* FOOTER */
footer { text-align: center; padding: clamp(1.5rem, 4vw, 2rem) 1rem; color: var(--gray); font-size: clamp(.8rem, 2vw, .9rem); border-top: 1px solid var(--border); margin-top: clamp(2rem, 5vw, 3rem); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-inner { display: flex; justify-content: space-between; }
  .menu-toggle { display: block; }
  .nav-links { position: absolute; top: 100%; inset-inline: 0; background: white; flex-direction: column; padding: 1rem 2rem; gap: 1rem; border-bottom: 1px solid var(--border); box-shadow: 0 10px 20px rgba(0,0,0,.05); display: none; }
  .nav-links.open { display: flex; }
}
@media (min-width: 480px) {
  .about-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clients-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 640px) {
  .services-grid, .tech-grid, .process-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .about-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .services-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .clients-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .process-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .services-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tech-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}







/* بهینه‌سازی ارتفاع کارت‌ها برای نمایش بهتر */
.tech-card, .process-step, .card {
  padding: 1.2rem 1rem !important;
  min-height: auto !important;
}

.tech-grid, .process-grid, .services-grid {
  margin-top: 1.5rem !important;
  margin-bottom: 0.5rem !important;
}

/* استثنا برای بخش تخصص‌ها (کارت‌ها در مرکز قرار بگیرند) */
#expertise {
  justify-content: center !important;
}

/* استثنا برای بخش تماس */
#contact {
  justify-content: center !important;
}

/* ═══ بهینه‌سازی نهایی ارتفاع ═══ */
section[id] {
  scroll-margin-top: 80px !important;
  padding-top: 20px !important;
  padding-bottom: 20px !important;
}
.tech-card, .process-step, .card {
  padding: 1.2rem 1rem !important;
}
.tech-grid, .process-grid, .services-grid {
  margin-top: 1rem !important;
  margin-bottom: 0.5rem !important;
}



/* SCROLL FIX - FULL VIEWPORT SECTIONS */

/* فاصله استاندارد برای لینک‌های داخلی با منوی ثابت */
html {
  scroll-padding-top: calc(var(--nav-height, 80px) + 12px);
}

/* هر بخش حداقل فضای قابل مشاهده مرورگر را پر کند */
section[id] {
  min-height: calc(100svh - var(--nav-height, 80px) - 12px) !important;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  scroll-margin-top: calc(var(--nav-height, 80px) + 12px) !important;
}

/* پشتیبانی از مرورگرهای قدیمی‌تر */
@supports not (height: 100svh) {
  section[id] {
    min-height: calc(100vh - var(--nav-height, 80px) - 12px) !important;
  }
}


/* CLIENTS - standalone section */
#clients .clients-box {
  margin-top: 0 !important;
}
