/* ============================
   DLZ New Portfolio — Glassmorphism Themes
   Theme 1: Wine, Golden, Black
   Theme 2: Light, Purple Glow, AI
   ============================ */

/* -------- RESET -------- */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:'Inter',system-ui,-apple-system,sans-serif;line-height:1.6;-webkit-font-smoothing:antialiased;overflow-x:hidden;min-height:100vh}
img{max-width:100%;height:auto;display:block}
a{text-decoration:none;color:inherit}
ul{list-style:none}
button{cursor:pointer;font-family:inherit}

/* Persian/RTL */
html[lang="fa"] body,
html[dir="rtl"] body{font-family:'Vazirmatn','Inter',system-ui,sans-serif}

/* ===========================
   THEME 1: WINE + GOLD + BLACK
   =========================== */
.theme-wine {
  --bg-primary: #0d0407;
  --bg-secondary: #1a080e;
  --bg-card: rgba(60, 15, 28, 0.35);
  --bg-glass: rgba(120, 30, 55, 0.15);
  --text-primary: #f5e6d0;
  --text-secondary: #d4af7a;
  --text-muted: #b8945a;
  --accent: #d4a043;
  --accent-light: #e8c47a;
  --wine: #6b1d2f;
  --wine-light: #8a2740;
  --gold: #d4a043;
  --gold-light: #e8c47a;
  --border: rgba(212, 160, 67, 0.2);
  --shadow: 0 8px 32px rgba(0,0,0,0.6);
  --glow: 0 0 40px rgba(212, 160, 67, 0.08);
  --gradient-hero: linear-gradient(135deg, #0d0407 0%, #1a080e 40%, #0d0407 100%);
  --gradient-accent: linear-gradient(135deg, #6b1d2f, #d4a043);
  --gradient-card: linear-gradient(145deg, rgba(60,15,28,0.4), rgba(30,8,14,0.6));
  --nav-bg: rgba(13, 4, 7, 0.8);
  --modal-bg: rgba(0,0,0,0.85);
  --shape-color: rgba(212, 160, 67, 0.06);
  --shape-border: rgba(212, 160, 67, 0.12);
}

/* ===========================
   THEME 2: DARK BLUE — NIGHT OCEAN
   =========================== */
.theme-blue {
  --bg-primary: #080c1a;
  --bg-secondary: #0f172a;
  --bg-card: rgba(79, 70, 229, 0.15);
  --bg-glass: rgba(79, 70, 229, 0.08);
  --text-primary: #f0f4ff;
  --text-secondary: #7dd3fc;
  --text-muted: #64748b;
  --accent: #4f46e5;
  --accent-light: #0ea5e9;
  --wine: #4f46e5;
  --wine-light: #0ea5e9;
  --gold: #06b6d4;
  --gold-light: #22d3ee;
  --border: rgba(14, 165, 233, 0.35);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  --glow: 0 0 40px rgba(79, 70, 229, 0.08);
  --gradient-hero: linear-gradient(135deg, #080c1a 0%, #0f172a 40%, #080c1a 100%);
  --gradient-accent: linear-gradient(135deg, #4f46e5, #0ea5e9, #06b6d4);
  --gradient-card: linear-gradient(145deg, rgba(79,70,229,0.15), rgba(15,23,42,0.5));
  --nav-bg: rgba(8, 12, 26, 0.85);
  --modal-bg: rgba(0, 0, 0, 0.85);
  --shape-color: rgba(79, 70, 229, 0.06);
  --shape-border: rgba(14, 165, 233, 0.15);
}

/* ===========================
   BASE LAYOUT
   =========================== */
.theme-wine, .theme-blue {
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background 0.5s ease, color 0.5s ease;
}
body.theme-blue { background: #080c1a; }

#theme-wrapper {
  position: relative;
  min-height: 100vh;
  background: var(--bg-primary);
  transition: background 0.5s ease;
}

.container {
  width: min(92%, 1140px);
  margin: 0 auto;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: fadeUp 0.6s ease both;
}

.section-title i { font-size: 1.3rem; }

.section-sub {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1rem;
}

/* Glass card base */
.glass-card {
  background: var(--gradient-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow), var(--glow);
  transition: all 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow), 0 0 50px rgba(212, 160, 67, 0.12);
}

/* Glass variants */
.glass-deep {
  background: linear-gradient(145deg, rgba(60,15,28,0.55), rgba(30,8,14,0.75));
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), 0 0 60px rgba(212, 160, 67, 0.06);
}

.glass-light {
  background: linear-gradient(145deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 160, 67, 0.1);
}

.glass-tinted {
  background: linear-gradient(145deg, rgba(212, 160, 67, 0.1), rgba(107, 29, 47, 0.2));
  backdrop-filter: blur(18px);
  border: 1px solid rgba(212, 160, 67, 0.15);
}

.glass-border-glow {
  position: relative;
  border-radius: 16px;
  background: var(--gradient-card);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow), 0 0 30px rgba(212, 160, 67, 0.06);
}

.glass-border-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1.5px;
  background: linear-gradient(135deg, var(--accent), transparent, var(--accent));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.theme-blue .glass-card:hover {
  box-shadow: var(--shadow), 0 0 50px rgba(79, 70, 229, 0.12);
}
.theme-blue .glass-deep {
  background: linear-gradient(145deg, rgba(79,70,229,0.55), rgba(15,23,42,0.75));
  box-shadow: var(--shadow), 0 0 60px rgba(79, 70, 229, 0.06);
}
.theme-blue .glass-light {
  background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(79,70,229,0.04));
  box-shadow: 0 4px 24px rgba(79, 70, 229, 0.04);
  border-color: rgba(14, 165, 233, 0.2);
}
.theme-blue .glass-tinted {
  background: linear-gradient(145deg, rgba(79,70,229,0.08), rgba(14,165,233,0.12));
  border-color: rgba(14, 165, 233, 0.2);
}
.theme-blue .glass-border-glow {
  box-shadow: var(--shadow), 0 0 30px rgba(79, 70, 229, 0.06);
}

.theme-blue .glass-border-glow::before {
  background: linear-gradient(135deg, #4f46e5, transparent, #06b6d4);
}

/* Light theme: accent glow on interactive elements */
.theme-blue .btn-primary {
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.25);
}
.theme-blue .btn-primary:hover {
  box-shadow: 0 6px 28px rgba(79, 70, 229, 0.4);
  transform: translateY(-2px);
}
.theme-blue .btn-ghost {
  background: rgba(79, 70, 229, 0.06);
  border-color: rgba(14, 165, 233, 0.2);
  color: #0ea5e9;
}
.theme-blue .btn-ghost:hover {
  background: rgba(79, 70, 229, 0.12);
  border-color: rgba(14, 165, 233, 0.35);
}
.theme-blue .hero-card {
  border-color: rgba(14, 165, 233, 0.25);
  box-shadow: 0 8px 40px rgba(79, 70, 229, 0.06), 0 0 80px rgba(14, 165, 233, 0.04);
}
.theme-blue .name .highlight { color: #06b6d4; }
.theme-blue .hero-badge {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(14, 165, 233, 0.25);
  color: #0ea5e9;
}
.theme-blue .section-title {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.theme-blue .section-title i {
  -webkit-text-fill-color: #06b6d4;
}
.theme-blue .project-card:hover {
  border-color: rgba(14, 165, 233, 0.3);
  box-shadow: 0 12px 40px rgba(79, 70, 229, 0.08), 0 0 60px rgba(14, 165, 233, 0.04);
}
.theme-blue .skill-card:hover {
  background: rgba(79, 70, 229, 0.06);
  border-color: rgba(14, 165, 233, 0.25);
}
.theme-blue .project-tags span {
  background: rgba(79, 70, 229, 0.08);
  color: #0ea5e9;
}
.theme-blue .project-link {
  color: #0ea5e9;
}
.theme-blue .info-item {
  border-color: rgba(14, 165, 233, 0.2);
}
.theme-blue .info-item i {
  color: #06b6d4;
}
.theme-blue .contact-card h3 i {
  color: #06b6d4;
}
.theme-blue .social {
  border-color: rgba(14, 165, 233, 0.25);
  color: #0ea5e9;
}
.theme-blue .social:hover {
  background: rgba(79, 70, 229, 0.1);
  border-color: rgba(14, 165, 233, 0.35);
  color: #06b6d4;
  box-shadow: 0 0 20px rgba(79, 70, 229, 0.15);
}
.theme-blue .form-row input,
.theme-blue .form-row textarea {
  border-color: rgba(14, 165, 233, 0.25);
  background: rgba(15, 23, 42, 0.6);
}
.theme-blue .form-row input:focus,
.theme-blue .form-row textarea:focus {
  border-color: #0ea5e9;
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}
.theme-blue .faq-item[open] {
  border-color: rgba(14, 165, 233, 0.3);
}
.theme-blue .faq-item summary:hover {
  color: #0ea5e9;
}
.theme-blue .faq-item p strong {
  color: #0ea5e9;
}
.theme-blue .modal-close {
  background: rgba(79, 70, 229, 0.08);
  color: #0ea5e9;
}
.theme-blue .modal-close:hover {
  background: rgba(79, 70, 229, 0.15);
}
.theme-blue .nav-links a:hover {
  background: rgba(79, 70, 229, 0.08);
  color: #0ea5e9;
}
.theme-blue .lang-btn,
.theme-blue .theme-btn {
  background: rgba(79, 70, 229, 0.06);
  border-color: rgba(14, 165, 233, 0.2);
  color: #0ea5e9;
}
.theme-blue .lang-btn:hover,
.theme-blue .theme-btn:hover {
  background: rgba(79, 70, 229, 0.12);
  border-color: rgba(14, 165, 233, 0.35);
}
.theme-blue .gallery-btn {
  background: rgba(15, 23, 42, 0.85);
  color: #0ea5e9;
  border-color: rgba(14, 165, 233, 0.25);
}
.theme-blue .gallery-btn:hover {
  background: rgba(15, 23, 42, 0.95);
  color: #06b6d4;
}
.theme-blue .tdot.active {
  background: #4f46e5;
}
.theme-blue .shape {
  opacity: 0.35;
  border-color: rgba(14, 165, 233, 0.1);
  background: radial-gradient(circle, rgba(79,70,229,0.04), transparent);
}
.theme-blue .seo-keywords {
  opacity: 0.3;
  color: var(--text-muted);
}
.theme-blue .logo-svg {
  filter: drop-shadow(0 0 8px rgba(79, 70, 229, 0.12));
}
.theme-blue .logo-svg:hover {
  filter: drop-shadow(0 0 14px rgba(79, 70, 229, 0.3));
}

/* ===========================
   FLOATING SHAPES
   =========================== */
.floating-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--shape-border);
  opacity: 0.5;
}

.shape-1 {
  width: 300px; height: 300px;
  top: 10%; left: -5%;
  animation: floatA 20s ease-in-out infinite;
  background: radial-gradient(circle, var(--shape-color), transparent 70%);
}

.shape-2 {
  width: 200px; height: 200px;
  top: 60%; right: -3%;
  animation: floatB 25s ease-in-out infinite;
  border-radius: 30%;
  background: radial-gradient(circle, var(--shape-color), transparent 70%);
}

.shape-3 {
  width: 150px; height: 150px;
  bottom: 15%; left: 10%;
  animation: floatC 18s ease-in-out infinite;
  background: radial-gradient(circle, var(--shape-color), transparent 70%);
}

.shape-4 {
  width: 100px; height: 100px;
  top: 30%; right: 15%;
  animation: floatA 22s ease-in-out infinite reverse;
  border-radius: 40%;
  border-width: 2px;
}

.shape-5 {
  width: 80px; height: 80px;
  bottom: 40%; left: 40%;
  animation: floatB 15s ease-in-out infinite;
  border-radius: 20%;
}

@keyframes floatA {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  33% { transform: translate(30px, -40px) rotate(120deg) scale(1.1); }
  66% { transform: translate(-20px, 20px) rotate(240deg) scale(0.9); }
}

@keyframes floatB {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-40px, 30px) rotate(90deg); }
  50% { transform: translate(20px, -50px) rotate(180deg); }
  75% { transform: translate(-30px, -20px) rotate(270deg); }
}

@keyframes floatC {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.15); }
}

/* ===========================
   HEADER / NAV
   =========================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s ease;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
}

.logo-svg {
  display: block;
  height: 30px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(212, 160, 67, 0.15));
  transition: filter 0.3s ease;
}

.logo-svg:hover {
  filter: drop-shadow(0 0 14px rgba(212, 160, 67, 0.35));
}

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-links a {
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: all 0.3s ease;
  transform: translateX(-50%);
  border-radius: 2px;
}

.nav-links a:hover::after,
.nav-links a:focus::after { width: 60%; }

.nav-links a:hover {
  background: var(--bg-glass);
  color: var(--accent-light);
}

/* Lang toggle button */
.lang-btn {
  min-width: 42px;
  height: 38px;
  padding: 0 0.6rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-glass);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.3s ease;
  margin-left: 0.3rem;
  letter-spacing: 0.5px;
}

.lang-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* Theme toggle button */
.theme-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-glass);
  color: var(--accent);
  font-size: 1rem;
  transition: all 0.3s ease;
  margin-left: 0.3rem;
}

.theme-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: rotate(30deg);
}

/* Hamburger */
.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 0;
  width: 40px;
  height: 40px;
  position: relative;
}

.nav-toggle .hamburger,
.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
  display: block;
  width: 26px;
  height: 2.5px;
  background: var(--accent);
  border-radius: 4px;
  position: absolute;
  left: 7px;
  transition: all 0.3s ease;
}

.nav-toggle .hamburger { top: 19px; }
.nav-toggle .hamburger::before { content: ''; top: -8px; }
.nav-toggle .hamburger::after { content: ''; top: 8px; }

.nav-toggle.active .hamburger { background: transparent; }
.nav-toggle.active .hamburger::before { top: 0; transform: rotate(45deg); }
.nav-toggle.active .hamburger::after { top: 0; transform: rotate(-45deg); }

/* ===========================
   HERO
   =========================== */
.hero {
  padding: 130px 0 70px;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--shape-color), transparent 70%);
  top: -250px;
  right: -200px;
  pointer-events: none;
  animation: pulseGlow 6s ease-in-out infinite;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2.5rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-content { animation: fadeLeft 0.8s ease both; }

.hero-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--accent);
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
  animation: fadeUp 0.6s ease both 0.2s;
}

.name {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
  animation: fadeUp 0.6s ease both 0.3s;
}

.name .highlight { color: var(--accent); }

.tagline {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 52ch;
  line-height: 1.6;
  animation: fadeUp 0.6s ease both 0.4s;
}

.tagline strong { color: var(--text-secondary); }

.hero-cta {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.6s ease both 0.5s;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 0;
  transition: all 0.25s ease;
}

.btn.primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(212, 160, 67, 0.25);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(212, 160, 67, 0.35);
}

.btn.ghost {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn.ghost:hover {
  background: var(--border);
  color: var(--accent-light);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  animation: fadeUp 0.6s ease both 0.6s;
}

.hero-meta i { margin-right: 0.4rem; color: var(--accent); }

/* Hero Glass Card */
.hero-visual { animation: fadeRight 0.8s ease both 0.3s; }

.hero-card {
  padding: 2rem;
  text-align: center;
}

.hero-profile {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 1.2rem;
  border: 5px solid var(--accent);
  box-shadow: 0 0 50px rgba(212, 160, 67, 0.3), 0 0 100px rgba(212, 160, 67, 0.1);
  animation: pulseGlow 3s ease-in-out infinite;
}

.profile-pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-card-icon {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.hero-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.hero-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

.hero-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.6rem;
  border-radius: 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.stat:hover {
  background: var(--border);
  transform: translateY(-2px);
}

.stat-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
  unicode-bidi: embed;
  direction: ltr;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===========================
   ABOUT
   =========================== */
.about {
  padding: 70px 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.about-text.glass-card,
.about-text.glass-deep {
  padding: 2rem;
}

.about-text p {
  margin-bottom: 1.2rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.about-text p:last-child { margin-bottom: 0; }

.about-info {
  display: grid;
  gap: 0.8rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  transition: all 0.3s ease;
}

.info-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.info-item i {
  font-size: 1.2rem;
  color: var(--accent);
  width: 28px;
  text-align: center;
}

.info-item div strong {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.info-item div span {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ===========================
   PROJECTS
   =========================== */
.projects {
  padding: 70px 0;
  background: var(--gradient-hero);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.project-card {
  cursor: pointer;
  overflow: hidden;
  transform: translateY(0);
  animation: fadeUp 0.6s ease both;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }

.project-thumb {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-thumb img {
  transform: scale(1.08);
}

/* Thumbnail carousel */
.thumb-carousel {
  position: relative;
  width: 100%;
  height: 100%;
}

.thumb-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.5s ease;
}

.thumb-slide.active {
  opacity: 1;
}

@keyframes thumbFadeIn {
  0% { opacity: 0; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

.thumb-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 2;
}

.tdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: all 0.3s ease;
  cursor: default;
}

.tdot.active {
  background: #fff;
  transform: scale(1.3);
}

.project-hover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  gap: 0.5rem;
  backdrop-filter: blur(2px);
}

.project-hover i { font-size: 1.2rem; }

.project-card:hover .project-hover {
  opacity: 1;
}

.project-body {
  padding: 1.2rem;
}

.project-body h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.project-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  line-height: 1.5;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.project-tags span {
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--accent);
  transition: all 0.2s ease;
}

.project-tags span:hover {
  background: var(--border);
}

/* ===========================
   CONTACT
   =========================== */
.contact {
  padding: 70px 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.2rem;
  align-items: start;
}

.contact-form {
  padding: 1.8rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-row label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.form-row input,
.form-row textarea {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 160, 67, 0.12);
}

.form-row input::placeholder,
.form-row textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.field-error {
  color: #e74c3c;
  font-size: 0.8rem;
  min-height: 1.1rem;
}

.form-actions {
  margin-top: 0.5rem;
}

.form-status {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--accent);
}

/* Contact aside */
.contact-aside {
  display: grid;
  gap: 1rem;
}

.contact-card {
  padding: 1.5rem;
}

.contact-card h3 {
  font-size: 1rem;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
}

.contact-card h3 i { font-size: 1rem; }

.contact-card p {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-card p i {
  color: var(--accent);
  width: 16px;
}

.contact-card a:hover {
  color: var(--accent-light);
}

/* Social */
.social-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.social {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: all 0.25s ease;
}

.social:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-3px);
}

/* ===========================
   FAQ
   =========================== */
.faq {
  padding: 70px 0;
}

.faq-grid {
  max-width: 800px;
  margin: 2rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.3s ease;
}

.faq-item[open] {
  border-color: var(--accent);
  box-shadow: var(--glow);
}

.faq-item summary {
  padding: 1rem 1.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  user-select: none;
  transition: color 0.2s ease;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.7rem;
  color: var(--accent);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq-item[open] summary::before {
  transform: rotate(180deg);
}

.faq-item summary:hover {
  color: var(--accent-light);
}

.faq-item p {
  padding: 0 1.4rem 1.2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-item p strong {
  color: var(--accent-light);
}

html[dir="rtl"] .faq-item summary::before {
  margin-left: 0.5rem;
  margin-right: 0;
}

@media (max-width: 640px) {
  .faq-item summary {
    font-size: 0.88rem;
    padding: 0.9rem 1rem;
  }
  .faq-item p {
    padding: 0 1rem 1rem;
    font-size: 0.85rem;
  }
}

/* ===========================
   FOOTER
   =========================== */
.site-footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent);
}


/* Persian SEO keywords — hidden from visitors, visible to crawlers */
.seo-keywords {
  display: none;
}
.seo-keywords span::before { content: '· '; }

/* ===========================
   MODALS
   =========================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--modal-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding: 0;
  animation: modalIn 0.35s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.85) translateY(30px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 1.1rem;
  z-index: 10;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(0,0,0,0.7);
  transform: rotate(90deg);
}

.modal-img {
  width: 100%;
  max-height: 320px;
  overflow: hidden;
}

.modal-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-body {
  padding: 1.5rem;
}

.modal-body h2 {
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
  color: var(--accent);
}

.modal-body p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  line-height: 1.6;
}

.modal-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.modal-tech span {
  padding: 0.3rem 0.8rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--accent);
}

.modal-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ===========================
   MODAL GALLERY
   =========================== */
.modal-gallery {
  position: relative;
  width: 100%;
  height: clamp(200px, 40vw, 320px);
  overflow: hidden;
  background: #0a0a0a;
}

.gallery-track {
  display: flex;
  transition: transform 0.4s ease;
}

.gallery-slide {
  min-width: 100%;
  width: 100%;
  height: clamp(200px, 40vw, 320px);
  object-fit: cover;
  display: block;
}

.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 1rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
}

.gallery-btn:hover {
  background: rgba(0,0,0,0.8);
}

.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }

.gallery-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dot.active {
  background: #fff;
  transform: scale(1.2);
}

/* ===========================
   KEYFRAME ANIMATIONS
   =========================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===========================
   SCROLLBAR
   =========================== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===========================
   RTL / PERSIAN
   =========================== */
html[dir="rtl"] .nav-links { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .nav-toggle { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .hero-meta i { margin-right: 0; margin-left: 0.4rem; }
html[dir="rtl"] .section-title i { order: 1; }
html[dir="rtl"] .info-item { flex-direction: row-reverse; }
html[dir="rtl"] .contact-card p i { margin-right: 0; margin-left: 0.4rem; }
html[dir="rtl"] .modal-close { right: auto; left: 12px; }
html[dir="rtl"] .stat-num { direction: ltr; unicode-bidi: embed; display: inline-block; }
html[dir="rtl"] .contact-card p a[href*="wa.me"],
html[dir="rtl"] .contact-card p a[href*="tel"],
html[dir="rtl"] .hero-meta span:first-child,
html[dir="rtl"] .hero-meta span:nth-child(2) { direction: ltr; unicode-bidi: embed; display: inline-block; }
html[dir="rtl"] .hero-meta span:first-child i,
html[dir="rtl"] .hero-meta span:nth-child(2) i { margin-right: 0; margin-left: 0.4rem; }
html[dir="rtl"] .footer-grid { flex-direction: row; }
html[dir="rtl"] .footer-links { flex-direction: row; }

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-visual { display: flex; justify-content: center; }

  .hero-card { max-width: 380px; }

  .hero-meta { justify-content: center; }

  .hero-cta { justify-content: center; }

  .tagline { margin-left: auto; margin-right: auto; }

  .about-grid { grid-template-columns: 1fr; }

  .projects-grid { grid-template-columns: repeat(2, 1fr); }

  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 0.8rem;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    gap: 0.2rem;
  }

  .nav-links.active { display: flex; }

  .nav-links a { padding: 0.8rem 1rem; width: 100%; }
  .nav-links a::after { display: none; }

  .lang-btn { margin-left: 0; margin-top: 0.5rem; width: 100%; min-width: unset; padding: 0.7rem; height: auto; }
  .theme-btn { margin-left: 0; margin-top: 0.3rem; width: 100%; padding: 0.7rem; height: auto; }

  .hero { padding: 100px 0 50px; }

  .projects-grid { grid-template-columns: 1fr; }

  .hero-card-stats { grid-template-columns: repeat(3, 1fr); }

  .footer-grid { flex-direction: column; gap: 0.5rem; text-align: center; }

  /* Fix mobile flickering */
  .site-header {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .nav-links {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .floating-shapes {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero-cta { flex-direction: column; align-items: center; }
  .btn { width: 100%; justify-content: center; }
  .modal-body { padding: 1rem; }
}
