/* =========================
   Cream-Gray Light Portfolio
   Background: #E4E4E2  •  Text: #000
   ========================= */



@font-face {
  font-family: 'Vazir';
  src: url('./assets/fonts/vazir/Vazir.woff2') format('woff2');
  src: url('./assets/fonts/vazir/Vazir.ttf') format('truetype');
}

@font-face {
  font-family: 'Roboto';
  src: url('./assets/fonts/roboto/Roboto.woff2') format('woff2');
  src: url('./assets/fonts/roboto/Roboto.ttf') format('truetype');
}

:root {
  --bg: #E4E4E2;
  --bg-elev: #ECECEA;
  --bg-card: #F2F2F0;
  --border: #C9C9C6;
  --border-strong: #A8A8A4;
  --text: #343434;
  --text-muted: #4a4a48;
  --text-dim: #6e6e6a;
  --accent: #343434;
  --accent-soft: rgba(0, 0, 0, 0.06);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --radius-lg: 22px;
  --nav-w: 76px;

  --font-en: 'Roboto',  system-ui, -apple-system, sans-serif;
  --font-fa: 'Vazir', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: url('assets/icons/select-cursor.png'), auto !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-en);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}



body[dir="rtl"] { font-family: var(--font-fa); }
  
a { color: inherit; text-decoration: none; }


::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #656565;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ========== Side Nav ========== */
.side-nav {
  position: fixed;
  top: 50%;
  left: 24px;
  transform: translateY(-50%);
  z-index: 50;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 14px 10px;
  box-shadow: var(--shadow);
}
/* Side nav stays in fixed position regardless of language */

.side-nav ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.nav-link {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all .25s ease;
  position: relative;
}
.nav-link svg { width: 20px; height: 20px; }
.nav-link:hover { color: var(--text); background: var(--accent-soft); }
.nav-link.active {
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 0 0 4px rgba(0,0,0,0.08);
}

/* ========== Top Controls ========== */
.top-controls {
  position: fixed; top: 24px; right: 24px;
  z-index: 50;
  display: flex; gap: 10px;
}
/* Language toggle stays in fixed position regardless of language */

.control-btn {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all .2s ease;
}
.control-btn:hover { background: var(--text); color: var(--bg); }

/* ========== Sections ========== */
main { padding-left: calc(var(--nav-w) + 24px); padding-right: 24px }
/* Main padding stays fixed — nav doesn't move in RTL */

.section {
  min-height: 100vh;
  padding: 100px 0 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.section-inner { width: 100%; max-width: 1100px; }
.section-head { margin-bottom: 40px; }
.section-head.center { text-align: center; }

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.section-title.center { text-align: center; }
.section-desc { color: var(--text-muted); font-size: 1.05rem; max-width: 640px; }
.section-head.center .section-desc { margin: 0 auto; }
.center-text { text-align: center; margin: 8px auto 0; }

.accent { color: var(--text); position: relative; }

/* ========== Hero ========== */
.hero { text-align: center; }
.hero-inner { max-width: 720px; margin: 0 auto; }

.avatar {
  width: 160px; height: 160px;
  margin: 0 auto 32px;
  position: relative;
  border-radius: 50%;
  display: block;
}
.avatar-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  animation: ringPulse 3s ease-in-out infinite;
}
.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.avatar-inner {
  position: absolute;
  inset: 0;
  border: 3px solid var(--text);
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: .6; }
  50% { transform: scale(1.05); opacity: 1; }
}

.hero-title {
  font-size: clamp(1.6rem, 3.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.hero-title .accent { display: inline-block; margin-left: 12px;}
body[dir="rtl"] .hero-title .accent { margin-left: 0; margin-right: 12px;}

.hero-role { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 20px; }
.hero-desc { color: var(--text-muted); margin-bottom: 32px; font-size: 1.05rem; }

.hero-social {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.social-icon {
  width: 28px;
  height: 28px;
  filter: grayscale(100%) brightness(0);
  transition: filter 0.3s ease, transform 0.2s ease;
}

.social-icon:hover {
  filter: grayscale(0%) brightness(1);
  transform: translateY(-2px);
}

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ========== Buttons ========== */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .2s ease;
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.18); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--accent-soft); border-color: var(--text); }
.btn.full { width: 100%; }

/* ========== About ========== */
.about-card {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}
.visual-card {
  aspect-ratio: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: grid; place-items: center;
  padding: 30px;
}
.hand-illustration { width: 100%; height: 100%; color: var(--text); }

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.stat-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.stat-label { color: var(--text-muted); font-size: .85rem; }

/* ========== Resume ========== */
.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 40px;
  margin-top: 40px;
}
.col-title {
  font-size: 1.3rem; 
  font-weight: 700;
  margin-bottom: 20px; 
  text-align: center;
  padding-bottom: 12px; 
  border-bottom: 1px solid var(--border);
  justify-content: center;
}
.card {
  display: flex; gap: 14px;
  align-items: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--text); transform: translateY(-2px); }
.card.outline {
  background: transparent;
  border-style: dashed;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
}
.card-icon {
  width: 40px; height: 40px;
  flex-shrink: 0;
  background: var(--text); color: var(--bg);
  border-radius: 10px;
  display: grid; place-items: center;
}
.card h4 { font-size: 1rem; margin-bottom: 4px; }
.card p { color: var(--text-muted); font-size: .9rem; }
.meta { color: var(--text-dim); font-size: .8rem; display: inline-block; margin-top: 6px; }

/* ========== Blogs ========== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 30px;
}
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--text);
  box-shadow: var(--shadow);
}
.blog-thumb {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 24px;
  display: grid; place-items: center;
  color: var(--text);
}
.blog-thumb svg { width: 100%; max-width: 220px; height: auto; }
.blog-body { padding: 20px; }
.blog-body h4 { font-size: 1.1rem; margin: 8px 0 8px; }
.blog-body p { color: var(--text-muted); font-size: .92rem; margin-bottom: 14px; }
.blog-link {
  font-weight: 600;
  font-size: .9rem;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.blog-link:hover { border-bottom-color: var(--text); }

/* ========== Contact ========== */
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 50px;
  margin-bottom: 60px;
  margin-left: auto;
  margin-right: auto;
}
.contact-form { display: flex; flex-direction: column; gap: 18px; margin-top: 30px; }
.contact-form label { display: flex; flex-direction: column; gap: 8px; font-weight: 500; font-size: .95rem; }
.contact-form input,
.contact-form textarea {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 14px 16px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  transition: border-color .2s ease;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--text);
}
.contact-form .input-icon {
  position: relative;
}
.contact-form .input-icon i {
  position: absolute;
  inset-block-start: 50%;
  transform: translateY(-50%);
  inset-inline-start: 14px;
  color: var(--border-strong);
  font-size: 16px;
  pointer-events: none;
}
.contact-form .input-icon:has(textarea) i {
  inset-block-start: 18px;
  transform: none;
}
.contact-form .input-icon input,
.contact-form .input-icon textarea {
  padding-inline-start: 40px;
  width: 100%;
  box-sizing: border-box;
  text-align: start;
}


.form-status { text-align: center; min-height: 20px; color: var(--text-muted); }
.form-status.success { color: #1a6b1a; }
.form-status.error { color: #b32424; }

  
/* ========== Footer ========== */
.footer {
  border-top: 1px solid var(--border);
  padding-top: 40px;
  text-align: center;
}
.footer-nav h4 { margin-bottom: 16px; font-weight: 700; }
.footer-links {
  display: flex; justify-content: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 30px;
}
.footer-links a {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .9rem;
  transition: all .2s ease;
}
.footer-links a:hover { background: var(--text); color: var(--bg); }
.copyright { color: var(--text-dim); font-size: .85rem; }

/* ========== Back to Top ========== */
.back-to-top {
  position: fixed;
  bottom: 65px; right: 20px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--text);
  border: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all .3s ease;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.back-to-top img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

/* Back-to-top stays in fixed position regardless of language */
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-4px); }

/* ========== Reveal animation ========== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .8s ease, transform .8s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ========== Responsive ========== */
@media (max-width: 860px) {
  .side-nav {
    top: auto; bottom: 16px; left: 50%; right: auto;
    transform: translateX(-50%);
    padding: 8px 12px;
  }
  /* Mobile bottom bar stays centered/fixed in both LTR and RTL */
  body[dir="rtl"] .side-nav {
    left: 50%; right: auto;
    transform: translateX(-50%);
  }
  .side-nav ul { flex-direction: row; gap: 4px; }
  .nav-link { width: 40px; height: 40px; }

  main { padding: 0 20px 100px !important; }

  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-visual { max-width: 280px; margin: 0 auto; width: 100%; }
  .about-stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stat { padding: 14px 8px; }
  .stat-num { font-size: 1.4rem; }

  .edu-grid { grid-template-columns: 1fr; gap: 30px; }
  .contact-card { padding: 30px 20px; }
  .top-controls { top: 16px; right: 16px; }
}
