/* ==========================================================
   نورین سافت — Style Sheet
   ========================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root{
  --bg:        #07060f;
  --bg-2:      #0d0b1a;
  --surface:   rgba(255,255,255,.04);
  --surface-2: rgba(255,255,255,.07);
  --border:    rgba(255,255,255,.10);
  --text:      #ECEBF5;
  --muted:     #9C9AB3;
  --brand:     #7C5CFC;
  --brand-2:   #22D3EE;
  --accent:    #F472B6;
  --radius:    20px;
  --radius-sm: 12px;
  --shadow:    0 20px 60px rgba(124,92,252,.25);
  --ease:      cubic-bezier(.22,1,.36,1);
}

html{ scroll-behavior: smooth; }

body{
  font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul{ list-style: none; }
::selection{ background: var(--brand); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar{ width: 10px; }
::-webkit-scrollbar-track{ background: var(--bg); }
::-webkit-scrollbar-thumb{ background: linear-gradient(var(--brand), var(--brand-2)); border-radius: 10px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Layout ---------- */
.container{ width: min(1200px, 92%); margin-inline: auto; }

/* ---------- Background ---------- */
.bg-mesh{
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: radial-gradient(ellipse at top, #140f2e 0%, var(--bg) 60%);
}
.blob{
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
  will-change: transform;
}
.blob-1{ width: 520px; height: 520px; background: #7C5CFC; top: -120px; right: -100px; animation: float1 18s ease-in-out infinite; }
.blob-2{ width: 480px; height: 480px; background: #22D3EE; bottom: -160px; left: -140px; animation: float2 22s ease-in-out infinite; }
.blob-3{ width: 380px; height: 380px; background: #F472B6; top: 40%; left: 40%; opacity: .28; animation: float3 26s ease-in-out infinite; }

@keyframes float1{ 0%,100%{ transform: translate(0,0) scale(1);} 50%{ transform: translate(-80px, 60px) scale(1.1);} }
@keyframes float2{ 0%,100%{ transform: translate(0,0) scale(1);} 50%{ transform: translate(90px,-70px) scale(1.15);} }
@keyframes float3{ 0%,100%{ transform: translate(0,0) scale(1);} 50%{ transform: translate(-60px,-60px) scale(1.2);} }

.bg-grid{
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
}

#particles{ position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* ---------- Header ---------- */
header{
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 14px 0;
  transition: all .4s var(--ease);
}
header.scrolled{
  background: rgba(7,6,15,.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.nav{ display: flex; align-items: center; justify-content: space-between; }

.logo{
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 20px; letter-spacing: -.5px;
}
.logo img{ width: 90px; height: 50px; object-fit: contain; }
.logo-text{
  background: linear-gradient(135deg, #fff 20%, var(--brand-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links{ display: none; gap: 28px; align-items: center; }
.nav-links a{
  font-size: 15px; color: var(--muted);
  transition: color .25s;
  position: relative;
}
.nav-links a:hover{ color: var(--text); }
.nav-links a::after{
  content:''; position:absolute; bottom:-6px; right:0; left:auto;
  width:0; height:2px; border-radius:2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width .3s var(--ease);
}
.nav-links a:hover::after{ width: 100%; }
@media (min-width: 768px){ .nav-links{ display: flex; } }

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 15px;
  transition: all .3s var(--ease);
  white-space: nowrap;
}
.btn-primary{
  background: linear-gradient(135deg, var(--brand) 0%, #9b7cff 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(124,92,252,.35);
}
.btn-primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(124,92,252,.55);
}
.btn-ghost{
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover{
  border-color: rgba(255,255,255,.25);
  background: var(--surface-2);
  transform: translateY(-2px);
}
.btn-full{ width: 100%; }

/* ---------- Hero ---------- */
.hero{
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 120px 0 80px;
  position: relative;
}
.hero-inner{ max-width: 900px; }

.hero-badge{
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-radius: 100px;
  background: rgba(124,92,252,.12);
  border: 1px solid rgba(124,92,252,.35);
  color: #c9baff;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 24px;
}
.hero-badge .dot{
  width: 8px; height: 8px; border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52,211,153,.2);
  animation: pulse 2s infinite;
}
@keyframes pulse{
  0%,100%{ box-shadow: 0 0 0 4px rgba(52,211,153,.2); }
  50%{ box-shadow: 0 0 0 8px rgba(52,211,153,0); }
}

.hero h1{
  font-size: clamp(40px, 8vw, 84px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 24px;
}
.hero h1 .grad{
  display: block;
  background: linear-gradient(135deg, #fff 30%, var(--brand) 60%, var(--brand-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero h1 .h1-sub{
  display: block;
  font-size: .32em;
  font-weight: 400;
  color: var(--muted);
  margin-top: 14px;
  letter-spacing: 0;
  line-height: 1.5;
}

.hero-tagline{
  font-size: clamp(18px, 2.4vw, 26px);
  color: var(--muted);
  margin-bottom: 40px;
  min-height: 1.6em;
  font-weight: 400;
}
.hero-tagline .cursor{
  display: inline-block;
  width: 3px; height: 1em;
  background: var(--brand-2);
  margin-right: 4px;
  vertical-align: text-bottom;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink{ 50%{ opacity: 0; } }

.services-list{
  display: flex; flex-direction: column; gap: 14px;
  margin-bottom: 44px;
}
.services-list li{
  display: flex; align-items: center; gap: 12px;
  font-size: 17px;
  color: #d5d3e6;
  opacity: 0;
  transform: translateY(20px);
  animation: riseIn .7s var(--ease) forwards;
  position: relative;
}
.services-list li:nth-child(1){ animation-delay: .2s; }
.services-list li:nth-child(2){ animation-delay: .35s; }
.services-list li:nth-child(3){ animation-delay: .5s; }
@keyframes riseIn{ to{ opacity: 1; transform: translateY(0); } }
.services-list li::before{
  content: '';
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 0 4px rgba(124,92,252,.15);
}
.services-list li::after{
  content: '✓';
  position: absolute;
  right: 5px;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  pointer-events: none;
}

.hero-cta{
  display: flex; gap: 14px; flex-wrap: wrap;
  opacity: 0;
  animation: riseIn .7s .7s var(--ease) forwards;
}

/* ---------- Sections ---------- */
section{ padding: 100px 0; position: relative; }

.section-head{ text-align: center; margin-bottom: 60px; }
.section-label{
  display: inline-block;
  font-size: 13px; font-weight: 600;
  color: var(--brand-2);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section-title{
  font-size: clamp(28px, 4.5vw, 48px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 14px;
}
.section-sub{
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
  font-size: 16px;
}

/* Reveal on scroll */
.reveal{
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.in{ opacity: 1; transform: translateY(0); }

/* ---------- About ---------- */
.about-grid{
  display: grid;
  gap: 50px;
  align-items: center;
}
@media (min-width: 900px){
  .about-grid{ grid-template-columns: 1.2fr 1fr; gap: 80px; }
}
.about-text p{ color: #c8c6d9; font-size: 17px; margin-bottom: 22px; }
.about-text .lead{
  font-size: 20px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 26px;
}
.about-text strong{ color: var(--brand-2); font-weight: 600; }

.about-points{ display: grid; gap: 14px; margin-top: 24px; }
.about-points li{
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all .3s var(--ease);
}
.about-points li:hover{
  border-color: rgba(124,92,252,.5);
  transform: translateX(-6px);
  background: var(--surface-2);
}
.about-points .icon{
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(124,92,252,.25), rgba(34,211,238,.25));
  display: grid; place-items: center;
  font-size: 18px;
}
.about-point-desc{
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

/* آواتار: هاله ثابت + عکس swing */
.about-avatar{
  position: relative;
  aspect-ratio: 1;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(124,92,252,.3), rgba(34,211,238,.15));
  box-shadow: var(--shadow);
}

/* هاله‌ی ثابت (بدون چرخش) */
.about-avatar::before{
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 31px;
  background: conic-gradient(from 0deg,
    var(--brand), var(--brand-2), var(--accent), var(--brand));
  opacity: .7;
  z-index: 0;
  filter: blur(4px);
}

/* عکس با انیمیشن swing (چپ و راست آروم) */
.about-avatar img{
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 28px;
  transform-origin: center center;
  animation: swing 6s ease-in-out infinite;
}

@keyframes swing{
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(-4deg); }
  50%  { transform: rotate(0deg); }
  75%  { transform: rotate(4deg); }
  100% { transform: rotate(0deg); }
}

/* ---------- Projects ---------- */
.projects-grid{
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px){ .projects-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px){ .projects-grid{ grid-template-columns: repeat(3, 1fr); } }

.project-card{
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .4s var(--ease);
  display: flex; flex-direction: column;
}
.project-card:hover,
.project-card:focus-visible{
  transform: translateY(-8px);
  border-color: rgba(124,92,252,.5);
  box-shadow: 0 24px 60px rgba(124,92,252,.25);
  outline: none;
}
.project-thumb{
  position: relative;
  aspect-ratio: 3/2;
  overflow: hidden;
  background: #12111f;
}
.project-thumb img{
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease);
}
.project-card:hover .project-thumb img{ transform: scale(1.08); }
.project-thumb::after{
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(7,6,15,.85) 100%);
}
.project-cat{
  position: absolute; top: 14px; right: 14px;
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(7,6,15,.75);
  border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  color: #fff;
  z-index: 1;
}
.project-body{
  padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
  flex: 1;
}
.project-title{
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px;
}
.project-desc{
  color: var(--muted);
  font-size: 14px;
  flex: 1;
}
.project-meta{
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.project-status{
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(52,211,153,.12);
  color: #6ee7b7;
  font-weight: 500;
}
.project-card .arrow{
  position: absolute;
  bottom: 20px; left: 20px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center;
  color: #fff;
  font-size: 16px;
  opacity: 0;
  transform: translateX(-10px);
  transition: all .4s var(--ease);
}
.project-card:hover .arrow,
.project-card:focus-visible .arrow{
  opacity: 1; transform: translateX(0);
}

/* ---------- Modals ---------- */
.modal{
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease);
}
.modal.open{ opacity: 1; pointer-events: auto; }
.modal-backdrop{
  position: absolute; inset: 0;
  background: rgba(4,3,10,.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-content{
  position: relative;
  width: min(900px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #14122a 0%, #0b0a1c 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 0;
  transform: translateY(30px) scale(.97);
  transition: transform .4s var(--ease);
  box-shadow: 0 40px 100px rgba(0,0,0,.6);
}
.modal.open .modal-content{ transform: translateY(0) scale(1); }
.modal-close{
  position: absolute; top: 16px; left: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  z-index: 10;
  transition: all .25s;
  font-size: 20px;
  line-height: 1;
}
.modal-close:hover{ background: rgba(244,114,182,.2); border-color: var(--accent); transform: rotate(90deg); }

.modal-hero{
  aspect-ratio: 16/9;
  width: 100%;
  overflow: hidden;
  border-radius: 24px 24px 0 0;
  background: #12111f;
}
.modal-hero img{ width: 100%; height: 100%; object-fit: cover; }

.modal-body{ padding: 32px; }
.modal-cat{
  display: inline-block;
  padding: 6px 14px;
  border-radius: 100px;
  background: rgba(124,92,252,.15);
  color: #c9baff;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
}
.modal-title{
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -.5px;
}
.modal-desc{
  color: #c8c6d9;
  font-size: 16px;
  line-height: 1.9;
  margin-bottom: 28px;
}
.modal-meta{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  padding: 22px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}
.modal-meta-item .label{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.modal-meta-item .value{
  font-weight: 600;
  font-size: 15px;
}
.tech-tags{
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 28px;
}
.tech-tags span{
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  color: #d5d3e6;
}
.modal-actions{ display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Contact modal ---------- */
.contact-modal .modal-content{ max-width: 960px; }
.contact-grid{
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 768px){
  .contact-grid{ grid-template-columns: 1fr 1.2fr; }
}
.contact-info{
  padding: 40px 32px;
  background: linear-gradient(135deg, rgba(124,92,252,.18), rgba(34,211,238,.10));
  border-radius: 24px 0 0 24px;
  position: relative;
  overflow: hidden;
}
@media (max-width: 767px){
  .contact-info{ border-radius: 24px 24px 0 0; }
}
.contact-info::before{
  content: '';
  position: absolute; top: -50%; right: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(124,92,252,.3), transparent 60%);
  animation: spin 20s linear infinite;
  pointer-events: none;
}
.contact-info-inner{ position: relative; z-index: 1; }
.contact-info h3{
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
}
.contact-info p{
  color: #c8c6d9;
  font-size: 15px;
  margin-bottom: 32px;
}
.contact-list{
  display: flex; flex-direction: column; gap: 18px;
  margin-bottom: 32px;
}
.contact-item{
  display: flex; align-items: center; gap: 14px;
  font-size: 15px;
}
.contact-item .icn{
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 18px;
}
.contact-item .lbl{ font-size: 12px; color: var(--muted); }
.contact-item .val{ font-weight: 600; }

.socials{ display: flex; gap: 10px; flex-wrap: wrap; }
.socials a{
  padding: 10px 16px;
  border-radius: 100px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  transition: all .25s var(--ease);
}
.socials a:hover{
  background: rgba(124,92,252,.25);
  border-color: var(--brand);
  transform: translateY(-2px);
}

.contact-form{ padding: 40px 32px; }
.contact-form h3{
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 22px;
}
.form-group{ margin-bottom: 18px; }
.form-group label{
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.form-group input,
.form-group textarea{
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: all .25s;
  outline: none;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus{
  border-color: var(--brand);
  background: rgba(124,92,252,.08);
  box-shadow: 0 0 0 4px rgba(124,92,252,.15);
}
.form-group textarea{ min-height: 110px; }

/* ---------- Footer ---------- */
footer{
  padding: 40px 0 30px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.footer-inner{
  display: flex; flex-direction: column; gap: 20px;
  align-items: center; justify-content: space-between;
  text-align: center;
}
@media (min-width: 768px){
  .footer-inner{ flex-direction: row; text-align: right; }
}
.footer-brand{
  display: flex; align-items: center; gap: 10px;
  font-weight: 700;
}
.footer-brand img{ width: 87px; height: 60px; }
.footer-copy{ color: var(--muted); font-size: 13px; }
.footer-socials{ display: flex; gap: 14px; }
.footer-socials a{
  color: var(--muted);
  font-size: 13px;
  transition: color .25s;
}
.footer-socials a:hover{ color: var(--brand-2); }

/* ---------- Focus visible (a11y) ---------- */
:focus-visible{
  outline: 2px solid var(--brand-2);
  outline-offset: 3px;
  border-radius: 4px;
}