/* Root CSS Variables - Highest Priority */
:root,
html,
html:root {
  --font-latin:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  --font-arabic:
    "Tajawal", "Noto Naskh Arabic", "Noto Sans Arabic", Tahoma, Arial,
    sans-serif;
  --font-arabic-heading:
    "Cairo", "Tajawal", "Noto Kufi Arabic", "Noto Sans Arabic", Tahoma,
    Arial, sans-serif;
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary-color: #ec4899;
  --primary-color-rgb: 99, 102, 241;
  --secondary-color-rgb: 236, 72, 153;
  --background-dark: #0f172a;
  --background-darker: #020617;
  --text-primary: #ffffff;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --card-background: rgba(30, 41, 59, 0.5);
  --border-color: rgba(148, 163, 184, 0.1);
  --gradient-1: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  --gradient-2: linear-gradient(
    135deg,
    var(--primary-light),
    var(--primary-color)
  );
  --primary-shadow: rgba(var(--primary-color-rgb), 0.4);
  --primary-shadow-light: rgba(var(--primary-color-rgb), 0.2);
  --primary-shadow-lighter: rgba(var(--primary-color-rgb), 0.1);
  --primary-bg-light: rgba(var(--primary-color-rgb), 0.1);
  --primary-bg-medium: rgba(var(--primary-color-rgb), 0.2);
  --secondary-bg-light: rgba(var(--secondary-color-rgb), 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

*:focus {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-latin);
  background: var(--background-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

:lang(ar) {
  font-family: var(--font-arabic);
}

html[lang="ar"] body {
  font-family: var(--font-arabic);
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] .section-title,
html[lang="ar"] .hero-title,
html[lang="ar"] .timeline-content h3,
html[lang="ar"] .timeline-content h4,
html[lang="ar"] .projects-subtitle,
html[lang="ar"] .logo {
  font-family: var(--font-arabic-heading);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-1);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link:hover::after {
  width: 100%;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  transition: all 0.3s ease;
}

.lang-toggle {
  border: 1px solid var(--primary-color);
  background: transparent;
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lang-toggle:hover {
  background: var(--primary-color);
  box-shadow: 0 8px 18px var(--primary-shadow-light);
  transform: translateY(-2px);
}

.lang-toggle:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 100px 20px 50px;
  background:
    radial-gradient(ellipse at top, var(--primary-bg-light), transparent),
    radial-gradient(ellipse at bottom, var(--secondary-bg-light), transparent);
}

.hero-content {
  max-width: 1200px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-text {
  z-index: 2;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.hero-title .line {
  display: block;
  opacity: 1;
  color: var(--text-primary);
}

.hero-title .name {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 1;
}

.hero-description {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  opacity: 1;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  opacity: 1;
}

.btn {
  padding: 12px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--gradient-1);
  color: var(--text-primary);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px var(--primary-shadow);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
}

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

.hero-social-group {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.social-link {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--card-background);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.social-link:hover {
  background: var(--gradient-1);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px var(--primary-shadow-light);
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.image-wrapper {
  position: relative;
  width: 400px;
  height: 400px;
  will-change: transform;
  transform: translateZ(0);
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid var(--primary-color);
  box-shadow: 0 20px 60px var(--primary-shadow-light);
  position: relative;
  z-index: 2;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.image-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background: var(--gradient-1);
  border-radius: 50%;
  opacity: 0.3;
  filter: blur(40px);
  z-index: 1;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.3;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.5;
  }
}

.scroll-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin: 0 auto 0.75rem;
  animation: bounce 2s infinite;
}

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

/* Section Styles */
section {
  padding: 100px 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.title-underline {
  width: 100px;
  height: 4px;
  background: var(--gradient-1);
  margin: 0 auto;
  border-radius: 2px;
}

/* About Section */
.about {
  background: var(--background-darker);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-img {
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.about-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.about-description-ar {
  display: none;
}

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

.stat-item {
  text-align: center;
  padding: 1.5rem;
  background: var(--card-background);
  border-radius: 15px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
  box-shadow: 0 10px 30px var(--primary-shadow-light);
}

.stat-item h3 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.5rem 0;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Experience Section */
.experience {
  background: var(--background-dark);
}

/* ── Timeline layout
   The vertical line and all markers share a single left anchor:
   --tl-offset  = distance from the left edge of .experience-timeline
                  to the centre of the line / markers.
   The timeline container gets padding-left equal to that offset plus
   half the card gap so cards never overlap the line.
─────────────────────────────────────────────────────────────────── */
.experience-timeline {
  --tl-offset: 1rem; /* centre of line from container left */
  --tl-gap: 2.5rem; /* space between line centre and card  */
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding-left: calc(var(--tl-offset) + var(--tl-gap));
}

.experience-timeline::before {
  content: "";
  position: absolute;
  left: var(--tl-offset);
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: var(--gradient-1);
  z-index: 0;
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  /* No extra padding-left needed — inherited from container */
}

.timeline-marker {
  position: absolute;
  /* Centre on the same axis as the line */
  left: calc(-1 * var(--tl-gap)); /* pull back from card edge to line */
  top: 1.5rem; /* align with first line of card text */
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 3px solid var(--background-dark);
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: auto;
  box-shadow: 0 0 0 3px var(--primary-color);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.timeline-marker:hover {
  transform: translateX(-50%) scale(1.35);
  box-shadow: 0 0 0 5px var(--primary-color);
}

.timeline-content {
  background: var(--card-background);
  padding: 2rem;
  border-radius: 15px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1; /* sit above the ::before line but below markers */
}

.timeline-content:hover {
  transform: translateX(8px);
  border-color: var(--primary-color);
  box-shadow: 0 10px 30px var(--primary-shadow-light);
}

.timeline-date {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.timeline-content h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.timeline-content h4 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-weight: 500;
}

.timeline-duties {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline-duties li {
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.6;
}

.timeline-duties li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

/* Education Section */
.education {
  background: var(--background-darker);
}

.education-content {
  display: flex;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto;
}

.education-card {
  background: var(--card-background);
  padding: 3rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all 0.3s ease;
  width: 100%;
}

.education-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary-color);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
}

.education-card h3 {
  font-size: 1.8rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--text-primary);
}

.education-card h4 {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-weight: 500;
}

.education-institution {
  font-size: 1.1rem;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.education-period {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.skill-card {
  padding: 2rem;
  background: var(--card-background);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary-color);
  box-shadow: 0 20px 40px var(--primary-shadow-light);
}

.skill-card h3 {
  font-size: 1.5rem;
  margin: 1rem 0;
  color: var(--text-primary);
}

.skill-card p {
  color: var(--text-muted);
  line-height: 1.6;
}

/* Projects Section */
.projects {
  background: var(--background-darker);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--card-background);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 60px var(--primary-shadow-light);
}

.project-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem 2rem;
  background: linear-gradient(
    135deg,
    var(--primary-bg-light),
    var(--secondary-bg-light)
  );
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.project-card:hover .project-icon-wrapper {
  background: linear-gradient(
    135deg,
    var(--primary-bg-medium),
    var(--secondary-bg-light)
  );
}

.project-link {
  color: var(--text-primary);
}

.project-info {
  padding: 2rem;
}

.project-info h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.project-info p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.project-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

.project-features li {
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.6;
  font-size: 0.95rem;
}

.project-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.1rem;
}

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

.project-tags span {
  padding: 5px 15px;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.faq-legacy-ar {
  display: none;
}

.footer-line-ar {
  display: none;
}

html[dir="rtl"] .nav-container {
  flex-direction: row-reverse;
}

html[dir="rtl"] .hero-text,
html[dir="rtl"] .about-text,
html[dir="rtl"] .timeline-content,
html[dir="rtl"] .project-info,
html[dir="rtl"] .contact-item,
html[dir="rtl"] .contact-form,
html[dir="rtl"] .projects-subheader,
html[dir="rtl"] .faq-item p,
html[dir="rtl"] .education-card {
  text-align: right;
}

html[dir="rtl"] .hero-social-group {
  align-items: flex-start;
}

html[dir="rtl"] .timeline-duties li,
html[dir="rtl"] .project-features li {
  padding-left: 0;
  padding-right: 1.5rem;
}

html[dir="rtl"] .timeline-duties li::before,
html[dir="rtl"] .project-features li::before {
  left: auto;
  right: 0;
}

html[dir="rtl"] .experience-timeline {
  padding-left: 0;
  padding-right: calc(var(--tl-offset) + var(--tl-gap));
}

html[dir="rtl"] .experience-timeline::before {
  left: auto;
  right: var(--tl-offset);
  transform: translateX(50%);
}

html[dir="rtl"] .timeline-marker {
  left: auto;
  right: calc(-1 * var(--tl-gap));
  transform: translateX(50%);
}

html[dir="rtl"] .timeline-marker:hover {
  transform: translateX(50%) scale(1.35);
}

html[dir="rtl"] .timeline-content:hover {
  transform: translateX(-8px);
}

html[dir="rtl"] .footer-line-en {
  display: none;
}

html[dir="rtl"] .footer-line-ar {
  display: inline;
}

.projects-subheader {
  margin: 5rem 0 2rem;
  text-align: center;
}

.projects-subtitle {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.projects-subheader p {
  color: var(--text-muted);
}

.oss-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.oss-card {
  display: flex;
  flex-direction: column;
  border-top: 3px solid var(--primary-color);
}

.oss-card .project-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.oss-card .project-info h3 {
  font-size: 1.25rem;
}

.oss-card .project-tags {
  margin-bottom: 1.5rem;
}

.project-repo-link {
  margin-top: auto;
  align-self: flex-start;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

/* FAQ Section */
.faq-list {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 15px;
  padding: 1.25rem 1.5rem;
  transition: border-color 0.3s ease;
}

.faq-item[open],
.faq-item:hover {
  border-color: var(--primary-color);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

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

.faq-item summary::after {
  content: "+";
  font-size: 1.5rem;
  line-height: 1;
  color: var(--primary-color);
  transition: transform 0.3s ease;
}

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

.faq-item p {
  margin-top: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* Contact Section */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-item {
  padding: 2rem;
  background: var(--card-background);
  border-radius: 15px;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all 0.3s ease;
}

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

.contact-item h3 {
  margin: 1rem 0 0.5rem;
  color: var(--text-primary);
}

.contact-item p {
  color: var(--text-secondary);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Stop the submit button from stretching to full column width */
.contact-form button[type="submit"] {
  align-self: flex-start;
  width: auto;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 15px;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-shadow-lighter);
}

.form-group textarea {
  resize: vertical;
}

/* Anchor tags styling */
a {
  color: var(--primary-color);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-light);
}

.contact-item a,
.contact-item p a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.form-message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
  font-weight: 500;
  display: none;
}

.form-message.success {
  display: block;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.form-message.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

/* Footer */
.footer {
  background: var(--background-darker);
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
}

.footer p {
  color: var(--text-muted);
}

.footer p + p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* Responsive Design */

/* Tablet and below */
@media (max-width: 1024px) {
  .container {
    padding: 0 30px;
  }

  .hero-content {
    gap: 3rem;
  }

  .about-content {
    gap: 3rem;
  }

  .contact-content {
    gap: 3rem;
  }

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

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

/* Mobile and small tablets */
@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }

  section {
    padding: 60px 0;
  }

  .section-header {
    margin-bottom: 2.5rem;
  }

  /* Navigation */
  .nav-menu {
    position: fixed;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background: var(--background-dark);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
  }

  .nav-menu.active {
    left: 0;
  }

  .nav-menu li {
    margin: 0.5rem 0;
  }

  .hamburger {
    display: flex;
  }

  /* Hero Section */
  .hero {
    padding: 80px 20px 40px;
    min-height: auto;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .hero-image {
    order: -1;
    margin-bottom: 1rem;
  }

  .image-wrapper {
    width: 250px;
    height: 250px;
    margin: 0 auto;
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: 1rem;
  }

  .hero-description {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
    padding: 14px 30px;
  }

  /* Keep the form submit button auto-sized on mobile too */
  .contact-form button[type="submit"] {
    width: auto;
    align-self: flex-start;
  }

  .social-links {
    justify-content: center;
    margin-top: 1rem;
  }

  .hero-social-group {
    display: flex;
    width: fit-content;
    margin: 0 auto;
  }

  .scroll-indicator {
    display: flex;
    width: fit-content;
    margin: 0 auto 0.75rem;
  }

  /* About Section */
  .about-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .stat-item {
    padding: 1.25rem;
  }

  .stat-item h3 {
    font-size: 1.5rem;
  }

  /* Experience Section */
  .experience-timeline {
    --tl-offset: 0.75rem;
    --tl-gap: 2rem;
  }

  .experience-timeline::before {
    left: var(--tl-offset);
  }

  .timeline-item {
    margin-bottom: 2rem;
  }

  .timeline-marker {
    width: 12px;
    height: 12px;
    top: 1.25rem;
    border: 2px solid var(--background-dark);
  }

  .timeline-content {
    padding: 1.5rem;
  }

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

  .timeline-content h4 {
    font-size: 1rem;
  }

  .timeline-duties li {
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
  }

  /* Education Section */
  .education-card {
    padding: 2rem 1.5rem;
  }

  /* Skills Section */
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .skill-card {
    padding: 1.5rem;
  }

  .skill-card h3 {
    font-size: 1.25rem;
  }

  .skill-card p {
    font-size: 0.9rem;
  }

  /* Projects Section */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .project-icon-wrapper {
    padding: 2rem 1.5rem 1.5rem;
  }

  .project-icon-wrapper lord-icon {
    width: 80px !important;
    height: 80px !important;
  }

  .project-info {
    padding: 1.5rem;
  }

  .project-info h3 {
    font-size: 1.25rem;
  }

  .project-info p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .project-features li {
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
  }

  .project-tags {
    flex-wrap: wrap;
  }

  .project-tags span {
    font-size: 0.75rem;
    padding: 4px 12px;
  }

  /* Contact Section */
  .contact-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-info {
    gap: 1.5rem;
  }

  .contact-item {
    padding: 1.5rem;
  }

  .contact-form {
    gap: 1.25rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 12px;
    font-size: 0.95rem;
  }

  /* Footer */
  .footer {
    padding: 1.5rem 0;
  }

  .footer p {
    font-size: 0.9rem;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  section {
    padding: 50px 0;
  }

  .section-title {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
  }

  .hero {
    padding: 70px 15px 30px;
  }

  .image-wrapper {
    width: 200px;
    height: 200px;
  }

  .hero-title {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
  }

  .hero-description {
    font-size: 0.95rem;
  }

  .nav-container {
    padding: 0 15px;
  }

  .logo span {
    font-size: 1.25rem;
  }

  .about-description {
    font-size: 1rem;
    line-height: 1.7;
  }

  .timeline-content {
    padding: 1.25rem;
  }

  .timeline-marker {
    width: 10px;
    height: 10px;
    top: 1rem;
    border: 2px solid var(--background-dark);
  }

  .project-icon-wrapper {
    padding: 1.5rem 1rem 1rem;
  }

  .project-icon-wrapper lord-icon {
    width: 60px !important;
    height: 60px !important;
  }

  .btn {
    padding: 12px 25px;
    font-size: 0.95rem;
  }

  .social-link {
    width: 45px;
    height: 45px;
  }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 60px 20px 30px;
  }

  .image-wrapper {
    width: 180px;
    height: 180px;
  }
}

/* Large screens */
@media (min-width: 1400px) {
  .container {
    max-width: 1400px;
  }

  .hero-content {
    max-width: 1400px;
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--background-darker);
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-1);
  border-radius: 5px;
}

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