/* ==========================================================================
   موقعي - المهندس أحمد محمد | مهندس تقنية المعلومات
   ========================================================================== */

/* ---------- المتغيرات والألوان ---------- */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --accent: #06b6d4;
  --success: #10b981;
  --bg: #f8fafc;
  --bg-alt: #eef2f7;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(99, 102, 241, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --gradient: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --header-h: 76px;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --bg-alt: #0f172a;
  --surface: #131c31;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #1e293b;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 50px rgba(6, 182, 212, 0.15);
}

/* ---------- إعادة الضبط ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 1rem;
}

h1, h2, h3, h4 {
  line-height: 1.3;
  font-weight: 700;
}

::selection {
  background: var(--primary);
  color: #fff;
}

/* ---------- أدوات مساعدة ---------- */
.container {
  width: min(1200px, 92%);
  margin-inline: auto;
}

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

.section {
  padding: 110px 0;
  position: relative;
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin-top: 8px;
}

.section-tag {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 50px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.section-sub {
  color: var(--text-muted);
  max-width: 600px;
  margin: 16px auto 0;
}

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.5);
}

.btn-outline {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-3px);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---------- شريط التقدم ---------- */
.progress-bar {
  position: fixed;
  top: 0;
  right: 0;
  height: 3px;
  width: 0;
  background: var(--gradient);
  z-index: 2000;
}

/* ---------- الهيدر ---------- */
.header {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: var(--header-h);
  z-index: 1000;
  background: rgba(248, 250, 252, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

[data-theme="dark"] .header {
  background: rgba(11, 17, 32, 0.6);
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.85);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .header.scrolled {
  background: rgba(11, 17, 32, 0.9);
}

.nav-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 700;
}

.logo strong {
  color: var(--primary);
}

.logo-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--gradient);
  color: #fff;
  font-family: monospace;
  font-size: 0.95rem;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.nav-links {
  display: flex;
  gap: 6px;
}

.nav-link {
  display: block;
  padding: 8px 14px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  transition: var(--transition);
}

.theme-toggle:hover {
  transform: rotate(20deg);
  border-color: var(--primary);
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: inline;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}
.profile-img {
  position: relative;
  overflow: hidden;
  width: 170px;
  height: 170px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--gradient);
  padding: 5px;
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
}

.profile-img img {
  position: absolute;
  inset: 5px;
  z-index: 1;
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
}
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 44px;
  height: 44px;
  justify-content: center;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}

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

.menu-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- القسم الرئيسي ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding: calc(var(--header-h) + 40px) 0 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: float 12s ease-in-out infinite;
}

.shape-1 {
  width: 420px;
  height: 420px;
  background: #6366f1;
  top: -100px;
  right: -80px;
}

.shape-2 {
  width: 360px;
  height: 360px;
  background: #06b6d4;
  bottom: -80px;
  left: -60px;
  animation-delay: -4s;
}

.shape-3 {
  width: 260px;
  height: 260px;
  background: #a855f7;
  top: 40%;
  left: 40%;
  animation-delay: -8s;
}

[data-theme="dark"] .shape {
  opacity: 0.25;
}

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

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

.badge {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 50px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  margin-bottom: 12px;
}

.hero h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
  color: var(--text-muted);
  font-weight: 600;
  min-height: 2.2em;
  margin-bottom: 20px;
}

.cursor {
  display: inline-block;
  color: var(--primary);
  animation: blink 1s steps(2, start) infinite;
  margin-inline-start: 2px;
}

@keyframes blink {
  to { visibility: hidden; }
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 580px;
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 36px;
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-links a {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  box-shadow: var(--shadow);
}

.social-links a:hover {
  color: #fff;
  background: var(--gradient);
  transform: translateY(-4px);
  border-color: transparent;
}

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

.profile-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 36px 30px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: floatCard 6s ease-in-out infinite;
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.profile-img {
  width: 170px;
  height: 170px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--gradient);
  padding: 5px;
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
}

.profile-img span {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat {
  padding: 14px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
}

.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.scroll-down {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 50px;
  border: 2px solid var(--text-muted);
  border-radius: 20px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.scroll-down span {
  width: 5px;
  height: 10px;
  border-radius: 5px;
  background: var(--primary);
  animation: scrollDot 2s infinite;
}

@keyframes scrollDot {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(18px); opacity: 0; }
}

/* ---------- عني ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 50px;
  align-items: start;
}

.about-text h3 {
  font-size: 1.6rem;
  margin-bottom: 20px;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.info-list {
  margin-top: 26px;
  display: grid;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow);
}

.info-list span {
  font-weight: 700;
  color: var(--primary);
  margin-inline-end: 6px;
}

.about-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.card h4 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.card p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* ---------- المهارات ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

.skill-group h3 {
  font-size: 1.2rem;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}

.skill {
  margin-bottom: 20px;
}

.skill-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.93rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.skill-head span:last-child {
  color: var(--primary);
}

.skill-bar {
  height: 9px;
  background: var(--bg-alt);
  border-radius: 50px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0;
  background: var(--gradient);
  border-radius: 50px;
  transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.tech-cloud {
  margin-top: 50px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.tech-cloud span {
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: var(--transition);
  font-family: monospace;
}

.tech-cloud span:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-3px);
}

/* ---------- الخدمات ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 30px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient);
  opacity: 0;
  transition: var(--transition);
  z-index: 0;
}

.service-card > * {
  position: relative;
  z-index: 1;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.service-card:hover::before {
  opacity: 0.05;
}

.service-card:hover {
  border-color: var(--primary);
}

.service-icon {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.1);
  margin-bottom: 22px;
}

.service-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---------- المشاريع ---------- */
.filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 50px;
}

.filter-btn {
  padding: 10px 24px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

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

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.project-card.hide {
  display: none;
}

.project-thumb {
  height: 200px;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  position: relative;
  overflow: hidden;
}

.project-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.25), transparent 60%);
}

.thumb-1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.thumb-2 { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.thumb-3 { background: linear-gradient(135deg, #10b981, #059669); }
.thumb-4 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.thumb-5 { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.thumb-6 { background: linear-gradient(135deg, #0ea5e9, #1e3a8a); }

.project-info {
  padding: 26px;
}

.project-info h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.project-info p {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin-bottom: 16px;
}

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

.tags span {
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--bg-alt);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: monospace;
}

/* ---------- الخبرات ---------- */
.timeline {
  position: relative;
  max-width: 850px;
  margin: 0 auto;
  padding-inline-end: 40px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 8px;
  width: 3px;
  background: var(--gradient);
  border-radius: 3px;
}

.timeline-item {
  position: relative;
  padding-inline-end: 40px;
  margin-bottom: 40px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  right: -2px;
  top: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 4px solid var(--primary);
  box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.15);
  transform: translateX(50%);
  z-index: 1;
}

.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.timeline-content:hover {
  transform: translateX(-6px);
  border-color: var(--primary);
}

.timeline-date {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(6, 182, 212, 0.1);
  padding: 4px 14px;
  border-radius: 50px;
  margin-bottom: 10px;
}

.timeline-content h3 {
  font-size: 1.25rem;
}

.timeline-content h4 {
  font-size: 1rem;
  color: var(--primary);
  font-weight: 600;
  margin: 4px 0 10px;
}

.timeline-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---------- التواصل ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 40px;
  align-items: start;
}

.contact-info {
  display: grid;
  gap: 20px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.contact-item:hover {
  transform: translateX(-6px);
  border-color: var(--primary);
}

.contact-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  border-radius: 16px;
  background: rgba(99, 102, 241, 0.1);
}

.contact-item h4 {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
}

.contact-item a,
.contact-item p {
  font-weight: 700;
  color: var(--text);
}

.contact-item a:hover {
  color: var(--primary);
}

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: var(--transition);
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.form-group.invalid input,
.form-group.invalid textarea {
  border-color: #ef4444;
}

.error-msg {
  display: block;
  color: #ef4444;
  font-size: 0.82rem;
  margin-top: 6px;
  min-height: 1em;
}

.form-status {
  margin-top: 18px;
  text-align: center;
  font-weight: 600;
  min-height: 1.5em;
}

.form-status.success {
  color: var(--success);
}

.form-status.error {
  color: #ef4444;
}

.btn.loading span {
  opacity: 0.7;
}

.btn.loading::after {
  content: "";
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- الفوتر ---------- */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 34px 0;
}

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

.footer p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.back-to-top {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-4px);
}

/* ---------- تأثيرات الظهور ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ---------- التجاوب ---------- */
@media (max-width: 1024px) {
  .nav-link {
    padding: 8px 10px;
    font-size: 0.88rem;
  }

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

@media (max-width: 900px) {
  :root {
    --header-h: 68px;
  }

  .menu-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: var(--header-h);
    inset-inline: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 20px 4%;
  }

  .nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links {
    flex-direction: column;
    gap: 4px;
  }

  .nav-link {
    padding: 12px 16px;
    font-size: 1rem;
  }

  .hero-content,
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
  }

  .hero-content {
    gap: 40px;
  }

  .hero-text {
    text-align: center;
  }

  .hero-buttons,
  .social-links {
    justify-content: center;
  }

  .hero-desc {
    margin-inline: auto;
  }

  .hero-text .badge {
    display: inline-block;
  }

  .section {
    padding: 80px 0;
  }
}

@media (max-width: 640px) {
  .skills-grid,
  .services-grid,
  .projects-grid,
  .about-cards,
  .form-row {
    grid-template-columns: 1fr;
  }

  .contact-form {
    padding: 26px 20px;
  }

  .stats {
    gap: 8px;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .timeline {
    padding-inline-end: 30px;
  }

  .timeline-item {
    padding-inline-end: 24px;
  }

  .timeline::before {
    right: 6px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .btn {
    padding: 13px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
