/* ============================================================
   amir-mirjafari-site v3 (trilingual) — en default
   Dark Mode + Glassmorphism + Subtle Grid
   ============================================================ */

:root {
  --primary: #0B1120;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.10);
  --secondary: #3B82F6;
  --secondary-glow: rgba(59, 130, 246, 0.35);
  --accent: #F59E0B;
  --accent-soft: rgba(245, 158, 11, 0.18);
  --text: #E6EDF6;
  --text-dim: #9AA7B8;
  --text-faint: #6B7889;
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Vazirmatn', system-ui, sans-serif;
  background: var(--primary);
  color: var(--text);
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* Persian / Arabic -> Vazirmatn for proper rendering */
body.lang-rtl { font-family: 'Vazirmatn', 'Inter', system-ui, sans-serif; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* Background layers */
.bg-grid {
  position: fixed; inset: 0; z-index: -3;
  background-image:
    linear-gradient(rgba(59,130,246,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}
.bg-glow {
  position: fixed; z-index: -2; border-radius: 50%;
  filter: blur(120px); opacity: 0.55; pointer-events: none;
  animation: float 14s ease-in-out infinite;
}
.bg-glow-1 { width: 520px; height: 520px; top: -160px; right: -120px; background: radial-gradient(circle, var(--secondary-glow), transparent 70%); }
.bg-glow-2 { width: 460px; height: 460px; bottom: -140px; left: -100px; background: radial-gradient(circle, var(--accent-soft), transparent 70%); animation-delay: -7s; }
@keyframes float { 0%,100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(40px) translateX(20px); } }

/* Navbar */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease), border-color 0.4s; border-bottom: 1px solid transparent; }
.nav.scrolled { background: rgba(11,17,32,0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff; background: linear-gradient(135deg, var(--secondary), #2563EB); box-shadow: 0 6px 20px var(--secondary-glow); }
.brand-text { font-weight: 700; font-size: 16px; letter-spacing: 0.2px; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--text-dim); text-decoration: none; font-size: 15px; font-weight: 500; transition: color 0.25s; position: relative; }
.nav-links a::after { content: ''; position: absolute; bottom: -6px; right: 0; width: 0; height: 2px; background: var(--accent); transition: width 0.3s var(--ease); }
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-right { display: flex; align-items: center; gap: 14px; }

/* Language switcher */
.lang-switch { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-family: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 10px; cursor: pointer; transition: border-color 0.25s, background 0.25s; }
.lang-btn:hover { border-color: var(--secondary); background: var(--surface-strong); }
.lang-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 170px; background: rgba(15,23,42,0.97); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: 12px; padding: 6px; list-style: none; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all 0.25s var(--ease); z-index: 120; box-shadow: 0 18px 50px rgba(0,0,0,0.45); }
.lang-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-menu li { padding: 10px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text-dim); transition: background 0.2s, color 0.2s; }
.lang-menu li:hover { background: var(--surface-strong); color: var(--text); }
[dir="ltr"] .lang-menu { right: 0; left: auto; }

.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 26px; cursor: pointer; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit; font-weight: 600; font-size: 15px; text-decoration: none; padding: 12px 22px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, color 0.25s; white-space: nowrap; }
.btn-lg { padding: 15px 30px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: linear-gradient(135deg, var(--secondary), #2563EB); color: #fff; box-shadow: 0 8px 26px var(--secondary-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px var(--secondary-glow); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-strong); border-color: var(--secondary); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

/* Hero */
.hero { padding: 170px 0 110px; position: relative; }
.hero-inner { max-width: 880px; }
.hero-badge { display: inline-block; padding: 8px 18px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; border: 1px solid rgba(245,158,11,0.3); margin-bottom: 26px; }
.hero-title { font-size: clamp(34px, 6vw, 62px); line-height: 1.25; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 26px; }
.grad { background: linear-gradient(120deg, var(--secondary), var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; display: inline; }
.hero-sub { font-size: clamp(16px, 2.2vw, 19px); color: var(--text-dim); max-width: 680px; margin-bottom: 38px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 64px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 44px; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 44px; font-weight: 800; color: #fff; line-height: 1; }
.stat-label { font-size: 14px; color: var(--text-dim); margin-top: 8px; }

/* Sections */
.section { padding: 96px 0; position: relative; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 56px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.section-head h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; line-height: 1.35; }

/* Glass card */
.glass-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 28px; transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s; }
.glass-card:hover { transform: translateY(-4px); border-color: rgba(59,130,246,0.4); box-shadow: 0 18px 50px rgba(0,0,0,0.35); }

/* About */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: stretch; }
.about-main p { color: var(--text-dim); font-size: 17px; margin-bottom: 18px; }
.about-main p:last-child { margin-bottom: 0; }
.about-side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.about-side .mini { display: flex; gap: 14px; align-items: flex-start; padding: 20px; }
.mini-ico { font-size: 26px; line-height: 1; }
.mini strong { display: block; font-size: 15px; color: var(--text); }
.mini small { color: var(--text-faint); font-size: 12.5px; line-height: 1.5; }

/* Timeline */
.timeline { position: relative; max-width: 860px; margin: 0 auto; padding-right: 28px; }
.timeline::before { content: ''; position: absolute; right: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--secondary), var(--accent)); opacity: 0.5; }
.tl-item { position: relative; margin-bottom: 22px; }
.tl-dot { position: absolute; right: 0; top: 22px; width: 16px; height: 16px; border-radius: 50%; background: var(--secondary); box-shadow: 0 0 0 4px rgba(59,130,246,0.18); z-index: 2; }
.tl-card { margin-right: 34px; padding: 22px 24px; }
.tl-meta { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.tl-role { font-size: 17px; font-weight: 700; color: var(--text); }
.tl-date { font-size: 13px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.tl-company { font-size: 14px; color: var(--secondary); font-weight: 600; margin-bottom: 10px; }
.tl-card p { color: var(--text-dim); font-size: 14.5px; }
.tl-note { text-align: center; color: var(--text-faint); font-size: 14px; margin-top: 30px; max-width: 760px; margin-left: auto; margin-right: auto; }

/* LTR timeline mirror */
[dir="ltr"] .timeline { padding-right: 0; padding-left: 28px; }
[dir="ltr"] .timeline::before { right: auto; left: 7px; }
[dir="ltr"] .tl-dot { right: auto; left: 0; }
[dir="ltr"] .tl-card { margin-right: 0; margin-left: 34px; }

/* Skills */
.skills-wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 820px; margin: 0 auto; }
.skill-chip { padding: 11px 20px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 14.5px; font-weight: 500; transition: all 0.3s var(--ease); }
.skill-chip:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* Value */
.value-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-bottom: 48px; }
.value-card h3 { font-size: 19px; margin-bottom: 10px; color: var(--text); }
.value-card p { color: var(--text-dim); font-size: 15px; }
.value-cta { text-align: center; padding: 44px 24px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(245,158,11,0.08)); border: 1px solid var(--border); }
.value-cta p { font-size: 20px; font-weight: 600; margin-bottom: 22px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.contact-info .eyebrow { margin-bottom: 12px; }
.contact-info h2 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; margin-bottom: 18px; }
.contact-lead { color: var(--text-dim); font-size: 16px; margin-bottom: 30px; max-width: 460px; }
.contact-channels { display: flex; flex-direction: column; gap: 14px; margin-bottom: 26px; }
.channel { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; transition: border-color 0.3s, transform 0.3s var(--ease), background 0.3s; }
.channel:hover { border-color: var(--secondary); transform: translateX(-4px); background: var(--surface-strong); }
.channel-ico { font-size: 24px; width: 44px; height: 44px; display: grid; place-items: center; background: var(--accent-soft); border-radius: 10px; flex-shrink: 0; }
.channel-text strong { display: block; font-size: 16px; }
.channel-text small { color: var(--text-faint); font-size: 13px; }
.social-row { display: flex; gap: 12px; }
.social { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 700; font-size: 14px; transition: all 0.3s var(--ease); }
.social:hover { background: var(--secondary); border-color: var(--secondary); color: #fff; transform: translateY(-3px); }

/* Form */
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: flex; flex-direction: column; gap: 8px; }
.form-row label { font-size: 14px; font-weight: 600; color: var(--text); }
.contact-form input, .contact-form textarea { font-family: inherit; font-size: 15px; color: var(--text); background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px 15px; transition: border-color 0.25s, box-shadow 0.25s, background 0.25s; width: 100%; resize: vertical; }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--text-faint); }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--secondary); box-shadow: 0 0 0 3px var(--secondary-glow); background: rgba(255,255,255,0.05); }
.contact-form input.invalid, .contact-form textarea.invalid { border-color: #EF4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
.form-status { font-size: 14px; min-height: 20px; text-align: center; font-weight: 600; }
.form-status.success { color: #34D399; }
.form-status.error { color: #F87171; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 30px 0; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--text-faint); font-size: 14px; }

/* Floating CTA */
.floating-cta { position: fixed; bottom: 26px; left: 26px; z-index: 90; background: linear-gradient(135deg, var(--accent), #D97706); color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; padding: 13px 22px; border-radius: 999px; box-shadow: 0 10px 30px rgba(245,158,11,0.4); transition: transform 0.3s var(--ease), box-shadow 0.3s; }
.floating-cta:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 14px 38px rgba(245,158,11,0.5); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 920px) {
  .about-grid { grid-template-columns: 1fr; }
  .value-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .nav-links { position: fixed; top: 74px; right: 0; left: 0; flex-direction: column; gap: 0; background: rgba(11,17,32,0.96); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); padding: 10px 24px 20px; transform: translateY(-130%); transition: transform 0.4s var(--ease); z-index: 99; }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid var(--border); }
  .nav-links a::after { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .about-side { grid-template-columns: 1fr; }
  .hero { padding: 140px 0 80px; }
  .hero-stats { gap: 28px; }
  .stat-num { font-size: 36px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .section { padding: 70px 0; }
  .timeline { padding-right: 14px; }
  .tl-card { margin-right: 26px; padding: 18px; }
  .floating-cta { bottom: 18px; left: 18px; padding: 11px 18px; font-size: 13px; }
}
@media (max-width: 680px) {
  [dir="ltr"] .timeline { padding-left: 14px; }
  [dir="ltr"] .tl-card { margin-left: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
