/* ===== CSS VARIABLES ===== */
:root {
  --bg-primary: #030712;
  --bg-secondary: #0a0f1e;
  --bg-card: rgba(10, 15, 35, 0.7);
  --accent-1: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #06b6d4;
  --gradient-main: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
  --gradient-text: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --border: rgba(99, 102, 241, 0.15);
  --border-hover: rgba(99, 102, 241, 0.4);
  --glow: 0 0 40px rgba(99, 102, 241, 0.3);
  --glow-strong: 0 0 80px rgba(99, 102, 241, 0.5);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 10.5pt;
  line-height: 1.7;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ===== THREE.JS CANVAS BACKGROUND ===== */
#canvas-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===== NOISE OVERLAY ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
}

/* ===== APP WRAPPER ===== */
.app {
  position: relative;
  z-index: 2;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== NAVBAR ===== */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: var(--transition);
}

nav.scrolled {
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 22px;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.nav-logo span {
  font-family: 'JetBrains Mono', monospace;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
}

/* ===== LANG SWITCH ===== */
.lang-btns {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.5px;
}

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

/* ===== MOBILE NAV ===== */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: rgba(3, 7, 18, 0.97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 24px;
    gap: 4px;
  }
  .nav-toggle { display: flex; }
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  position: relative;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 60px;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 28px;
  animation: pulse-border 3s ease infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(99, 102, 241, 0.3); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.2); }
  50%       { border-color: rgba(99, 102, 241, 0.6); box-shadow: 0 0 0 6px rgba(99, 102, 241, 0); }
}

.badge-dot {
  width: 7px; height: 7px;
  background: #6366f1;
  border-radius: 50%;
  animation: blink 1.5s ease infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.hero-title {
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 20px;
}

.hero-title .name-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 400;
  max-width: 540px;
  margin-bottom: 36px;
  line-height: 1.8;
}

/* ===== TYPING WIDGET ===== */
.typing-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.2);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 36px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: #67e8f9;
}

#typed-text { min-width: 200px; }

.cursor {
  display: inline-block;
  width: 2px; height: 18px;
  background: #67e8f9;
  margin-left: 2px;
  animation: blink-cursor 0.8s step-end infinite;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent);
  opacity: 0;
  transition: var(--transition);
}

.btn:hover::before { opacity: 1; }

.btn-primary {
  background: var(--gradient-main);
  border: none;
  color: #fff;
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.6);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-ghost:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  background: rgba(99, 102, 241, 0.08);
}

/* ===== HERO CARD ===== */
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(99, 102, 241, 0.06) 60deg, transparent 120deg);
  animation: rotate-glow 10s linear infinite;
}

@keyframes rotate-glow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.hero-card-inner { position: relative; z-index: 1; }

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.status-dot {
  width: 10px; height: 10px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
  animation: blink 2s ease infinite;
}

.status-text { font-size: 13px; font-weight: 500; color: #86efac; }

.profile-stat {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.stat-item { text-align: center; }

.stat-number {
  font-size: 32px;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tag {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition);
}

.tech-tag:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
}

/* ===== SECTIONS ===== */
section {
  padding: 100px 0;
  position: relative;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent-1);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.section-label::before {
  content: '';
  width: 24px; height: 2px;
  background: var(--gradient-main);
  border-radius: 2px;
}

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 16px;
  line-height: 1.15;
}

.section-title span {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 17px;
  max-width: 600px;
  margin-bottom: 60px;
}

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(20px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.skill-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: var(--glow), 0 20px 40px rgba(0, 0, 0, 0.4);
}

.skill-card-inner { position: relative; z-index: 1; }

.skill-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 18px;
}

.skill-icon.purple { background: rgba(99, 102, 241, 0.15); }
.skill-icon.cyan   { background: rgba(6, 182, 212, 0.15); }
.skill-icon.violet { background: rgba(139, 92, 246, 0.15); }
.skill-icon.green  { background: rgba(34, 197, 94, 0.15); }

.skill-name { font-size: 17px; font-weight: 700; margin-bottom: 8px; }

.skill-desc { color: var(--text-secondary); font-size: 14px; line-height: 1.7; }

.skill-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.skill-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

@media (max-width: 768px) {
  .projects-grid { grid-template-columns: 1fr; }
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(20px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: var(--glow), 0 20px 40px rgba(0, 0, 0, 0.4);
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-main);
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition);
}

.project-card:hover::before { transform: scaleX(1); }

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.project-emoji {
  width: 48px; height: 48px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.project-arrow {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  transition: var(--transition);
  flex-shrink: 0;
}

.project-card:hover .project-arrow {
  border-color: var(--accent-1);
  color: var(--accent-1);
  background: rgba(99, 102, 241, 0.1);
  transform: rotate(45deg);
}

.project-name { font-size: 18px; font-weight: 700; margin-bottom: 10px; }

.project-desc {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.75;
  flex: 1;
  margin-bottom: 20px;
}

.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.project-tag {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ===== CONTACT ===== */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 768px) {
  .contact-wrapper { grid-template-columns: 1fr; }
}

.contact-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.contact-title { font-size: 26px; font-weight: 800; margin-bottom: 12px; }

.contact-sub {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
  line-height: 1.8;
}

.contact-links { display: flex; flex-direction: column; gap: 14px; }

.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: var(--transition);
  font-weight: 500;
  font-size: 14px;
}

.contact-link:hover {
  border-color: var(--border-hover);
  background: rgba(99, 102, 241, 0.08);
  transform: translateX(6px);
}

.contact-link-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.contact-link-text { flex: 1; }

.contact-link-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
}

.contact-link-value { font-size: 14px; color: var(--text-primary); }

/* ===== CTA CARD ===== */
.cta-card {
  background: var(--gradient-main);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.cta-card::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -40px;
  width: 150px; height: 150px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.cta-inner { position: relative; z-index: 1; }

.cta-title { font-size: 26px; font-weight: 800; color: #fff; margin-bottom: 12px; }

.cta-sub { color: rgba(255, 255, 255, 0.8); font-size: 15px; margin-bottom: 28px; line-height: 1.8; }

.btn-white {
  background: #fff;
  color: #6366f1;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.btn-white:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  position: relative;
  z-index: 2;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-logo {
  font-size: 18px;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-copy { color: var(--text-muted); font-size: 14px; }

.footer-copy span {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}

/* ===== SCROLL ANIMATIONS ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays */
.reveal:nth-child(1) { transition-delay: 0ms; }
.reveal:nth-child(2) { transition-delay: 80ms; }
.reveal:nth-child(3) { transition-delay: 160ms; }
.reveal:nth-child(4) { transition-delay: 240ms; }
.reveal:nth-child(5) { transition-delay: 320ms; }
.reveal:nth-child(6) { transition-delay: 400ms; }
.reveal:nth-child(7) { transition-delay: 480ms; }
.reveal:nth-child(8) { transition-delay: 560ms; }
.reveal:nth-child(9) { transition-delay: 640ms; }

/* ===== GLOW ORBS ===== */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}

.orb-1 { width: 500px; height: 500px; background: rgba(99, 102, 241, 0.10); top: -100px; right: -100px; }
.orb-2 { width: 400px; height: 400px; background: rgba(139, 92, 246, 0.08); bottom: 100px; left: -100px; }
.orb-3 { width: 300px; height: 300px; background: rgba(6, 182, 212, 0.06); top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* ===== SCROLL PROGRESS BAR ===== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--gradient-main);
  z-index: 1000;
  transition: width 0.1s linear;
}

/* ===== RTL SUPPORT ===== */
[dir="rtl"] .section-label::before { display: none; }
[dir="rtl"] .section-label::after {
  content: '';
  width: 24px; height: 2px;
  background: var(--gradient-main);
  border-radius: 2px;
}
[dir="rtl"] .contact-link:hover { transform: translateX(-6px); }
[dir="rtl"] .hero-subtitle { max-width: 100%; }
