/*
==================================================
|               Root Variables                   |
| Updated: Hero spacing optimized v4             |
==================================================
*/
:root {
  --primary: #8b5cf6;
  --secondary: #3b82f6;
  --accent: #ec4899;
  --text-primary: #eef1ff;
  --text-muted: rgba(203, 213, 225, 0.75);
  --bg-card: rgba(15, 16, 36, 0.7);
  --gradient-hero: linear-gradient(
    135deg,
    rgba(11, 14, 28, 0.92) 0%,
    rgba(18, 7, 43, 0.94) 55%,
    rgba(9, 12, 27, 0.96) 100%
  );
  --container: min(1440px, 96vw);
  --font-hero: clamp(1.4rem, 5.8vw, 4.8rem);
  --font-typed: clamp(1rem, 3.4vw, 1.8rem);
  --font-h2: clamp(1.8rem, 4vw, 3rem);
  --font-body: clamp(1rem, 2vw, 1.08rem);
  --radius-md: 24px;
  --radius-sm: 16px;
  --transition: 0.35s ease;
  --backdrop-blur: blur(24px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", "Segoe UI", system-ui, -apple-system,
    BlinkMacSystemFont, sans-serif;
  background: radial-gradient(
      circle at top left,
      rgba(59, 130, 246, 0.16),
      transparent 45%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(236, 72, 153, 0.18),
      transparent 55%
    ),
    #030712;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body[data-theme="light"] {
  background: linear-gradient(140deg, #f5f7ff 0%, #eef1ff 65%, #fdf2f8 100%);
  color: #1e1f2a;
  --text-primary: #1e1f2a;
  --text-muted: rgba(71, 85, 105, 0.7);
  --bg-card: rgba(255, 255, 255, 0.78);
  /* Light hero gradient to replace the dark one */
  --gradient-hero: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(246, 248, 255, 0.98) 55%,
    rgba(255, 245, 250, 0.98) 100%
  );
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.section-heading {
  margin-bottom: clamp(2rem, 6vw, 3.2rem);
  text-align: center;
}

.section-heading h2 {
  margin: 0;
  font-size: var(--font-h2);
  letter-spacing: 0.02em;
  font-weight: 600;
}

.section-description {
  max-width: 720px;
  margin: 0 auto clamp(1.8rem, 4vw, 2.6rem);
  font-size: var(--font-body);
}

.card-grid,
.skills-grid,
.projects-grid,
.stats-grid,
.content-embed-grid,
.cta-row {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.4rem);
}

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

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

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

.cta-row {
  grid-auto-flow: column;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(1rem, 2vw, 1.6rem);
}

.section {
  width: var(--container);
  margin: clamp(2rem, 4vw, 3rem) auto;
  padding: clamp(1.6rem, 3.5vw, 2.4rem);
  border-radius: var(--radius-md);
}

.section.hero {
  position: relative;
  padding-top: clamp(5rem, 12vw, 8rem);
  padding-bottom: clamp(3rem, 8vw, 5rem);
  overflow: visible;
}

/* ==============================================================
     Loading Screen
     -------------------------------------------------------------- */
.loading-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  background: rgba(15, 15, 20, 0.9);
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-spinner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 4px solid rgba(139, 92, 246, 0.2);
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
  margin: auto;
}

.loading-text {
  margin-top: 1rem;
  text-align: center;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-size: 0.95rem;
}

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

/* ==============================================================
     Background FX
     -------------------------------------------------------------- */
.particle-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  filter: blur(0.3px);
}

.cursor-follower {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.45);
  background: radial-gradient(
    circle,
    rgba(139, 92, 246, 0.35),
    transparent 65%
  );
  pointer-events: none;
  z-index: 999;
  transform: translate(-9999px, -9999px);
  mix-blend-mode: screen;
}

.scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  height: 4px;
  width: 0;
  background: linear-gradient(90deg, var(--secondary), var(--accent));
  z-index: 9000;
  transition: width 0.12s ease;
}

/* ==============================================================
     Header & Navigation
     -------------------------------------------------------------- */
.site-header {
  position: sticky;
  inset: clamp(1.2rem, 3vw, 2rem) auto auto;
  width: var(--container);
  margin: clamp(1.2rem, 3vw, 2rem) auto 0;
  padding: clamp(0.8rem, 2vw, 1.2rem) clamp(1rem, 3vw, 1.6rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  z-index: 2000;
}

.header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1rem, 2vw, 1.8rem);
}

.brand {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  white-space: nowrap;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 1.6vw, 1.3rem);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 1.6vw, 1.4rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  position: relative;
  font-size: 0.95rem;
  padding: 0.35rem 0;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  inset: auto 0 -0.25rem;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

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

.nav-link.active::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(0.6rem, 1.6vw, 1rem);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition),
    background var(--transition);
}

.icon-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(139, 92, 246, 0.32);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.6rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
  color: var(--text-primary);
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.3),
    rgba(59, 130, 246, 0.25)
  );
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: transform var(--transition), box-shadow var(--transition),
    background var(--transition);
}

.header-actions .btn {
  white-space: nowrap;
  padding-inline: clamp(1.4rem, 3vw, 2rem);
}

#header-cv-btn .cv-short {
  display: none;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.55),
    rgba(236, 72, 153, 0.55)
  );
  opacity: 0;
  transition: opacity var(--transition);
}

.btn span,
.btn strong,
.btn em {
  position: relative;
  z-index: 1;
}

.btn:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 45px rgba(59, 130, 246, 0.35);
}

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

.btn.secondary {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.3),
    rgba(236, 72, 153, 0.25)
  );
}

.btn.tertiary {
  background: linear-gradient(
    135deg,
    rgba(236, 72, 153, 0.3),
    rgba(139, 92, 246, 0.25)
  );
}

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 15, 20, 0.55);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  transition: transform var(--transition);
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 4px;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

.nav-toggle.active span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.nav-toggle.active span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.mobile-nav {
  position: absolute;
  top: calc(100% + 0.8rem);
  left: clamp(1rem, 3vw, 1.6rem);
  right: clamp(1rem, 3vw, 1.6rem);
  padding: clamp(1.5rem, 4vw, 2rem);
  display: none;
  backdrop-filter: var(--backdrop-blur);
  background: var(--bg-card);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(139, 92, 246, 0.1);
  z-index: 100;
}

body[dir="rtl"] .mobile-nav {
  left: clamp(1rem, 3vw, 1.6rem);
  right: clamp(1rem, 3vw, 1.6rem);
}

.mobile-nav.open {
  display: block;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.mobile-nav-link {
  font-size: 1rem;
  color: var(--text-primary);
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  text-align: center;
}

body[dir="rtl"] .mobile-nav-link {
  text-align: center;
}

.mobile-nav-link:hover {
  background: rgba(139, 92, 246, 0.15);
  transform: translateX(4px);
}

body[dir="rtl"] .mobile-nav-link:hover {
  transform: translateX(-4px);
}

/* ==============================================================
     Hero Section
     -------------------------------------------------------------- */
.hero {
  background: var(--gradient-hero);
  position: relative;
  padding-top: clamp(5rem, 12vw, 8rem);
  padding-bottom: clamp(3rem, 8vw, 5rem);
  overflow: visible;
}

.hero-grid {
  display: grid;
  gap: clamp(1rem, 2vw, 2rem);
  grid-template-columns: 0.85fr minmax(340px, 420px);
  align-items: center;
}

.hero-info {
  display: grid;
  text-align: left;
  justify-items: start;
  padding-right: clamp(0.5rem, 1.2vw, 1rem);
}

.hero-media {
  justify-self: end;
  flex-shrink: 0;
}

.eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(245, 246, 251, 0.65);
}

.hero-name {
  margin: 0;
  font-size: var(--font-hero);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  white-space: nowrap;
}

.hero-typing {
  font-size: var(--font-typed);
  font-weight: 500;
  color: rgba(203, 213, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
}

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

.hero-details {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  justify-items: start;
}

.hero-detail {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  justify-content: flex-start;
  text-align: left;
}

.hero-detail a {
  color: var(--text-primary);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-start;
  /* Added margin to increase spacing from email/details to social icons */
  margin-top: clamp(0.6rem, 1.6vw, 1rem);
}

body[dir="rtl"] .hero-info {
  text-align: right;
  justify-items: end;
  padding-right: 0;
  padding-left: clamp(1rem, 2.5vw, 2rem);
}

body[dir="rtl"] .hero-media {
  justify-self: start;
}

body[dir="rtl"] .hero-details {
  justify-items: end;
}

body[dir="rtl"] .hero-detail {
  flex-direction: row-reverse;
  text-align: right;
}

body[dir="rtl"] .hero-actions {
  justify-content: flex-end;
}

body[dir="rtl"] .social-links {
  justify-content: flex-end;
  flex-direction: row-reverse;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  justify-content: flex-start;
}

.social-link {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.social-link:hover {
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 18px 35px rgba(236, 72, 153, 0.32);
}

.hero-image-wrap {
  width: min(450px, 75vw);
  height: min(450px, 75vw);
  margin-inline: -3rem 0;
  border-radius: 50%;
  overflow: hidden;
  padding: clamp(0.5rem, 1.2vw, 0.7rem);
  background: linear-gradient(
    200deg,
    rgba(139, 92, 246, 0.4),
    rgba(59, 130, 246, 0.2)
  );
  box-shadow: 0 20px 60px rgba(139, 92, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

body[dir="rtl"] .hero-image-wrap {
  width: min(470px, 78vw);
  height: min(470px, 78vw);
  margin-inline: 0 -3rem;
}

.hero-image-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  background: linear-gradient(
    135deg,
    rgba(15, 16, 36, 0.95),
    rgba(18, 7, 43, 0.98)
  );
}

/* ==============================================================
     Timeline & Cards
     -------------------------------------------------------------- */
.timeline {
  position: relative;
  margin: 0;
  display: grid;
  gap: 1.6rem;
  padding-left: 2rem;
}

body[dir="rtl"] .timeline {
  padding-left: 0;
  padding-right: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    180deg,
    rgba(139, 92, 246, 0.5),
    rgba(59, 130, 246, 0.2)
  );
  z-index: 0;
}

/* RTL support for timeline */
body[dir="rtl"] .timeline::before {
  left: auto;
  right: 0.5rem;
}

.timeline-item {
  position: relative;
  padding: clamp(1.2rem, 3vw, 1.8rem);
  padding-left: clamp(1.5rem, 3vw, 2rem);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 40px rgba(15, 15, 20, 0.35);
  z-index: 1;
}

body[dir="rtl"] .timeline-item {
  padding-left: clamp(1.2rem, 3vw, 1.8rem);
  padding-right: clamp(1.5rem, 3vw, 2rem);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.25rem;
  top: clamp(1.4rem, 2vw, 1.6rem);
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
  z-index: 2;
}

/* RTL support for timeline dots */
body[dir="rtl"] .timeline-item::before {
  left: auto;
  right: -1.25rem;
}

.timeline-title {
  margin-top: 0;
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  font-weight: 600;
}

.timeline-description {
  margin-bottom: 0;
  font-size: 0.98rem;
}

.glass-card {
  padding: clamp(1.4rem, 4vw, 2rem);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  /* Use theme-aware card background */
  background: var(--bg-card);
  box-shadow: 0 15px 45px rgba(15, 15, 20, 0.45);
  transition: transform var(--transition), box-shadow var(--transition);
}

.glass-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 25px 60px rgba(139, 92, 246, 0.35);
}

.experience-card h3,
.service-card h3,
.skill-card h3,
.project-card h3 {
  margin-top: 0;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-weight: 600;
}

.bullet-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.6rem;
  font-size: 0.97rem;
  color: var(--text-muted);
}

.skill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.skill-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
}

/* ==============================================================
     Content Creation
     -------------------------------------------------------------- */
.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card {
  padding: clamp(1.4rem, 3vw, 2rem);
  text-align: center;
  border-radius: var(--radius-md);
}

.stat-value {
  display: block;
  font-size: clamp(2.2rem, 6vw, 3.1rem);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.04em;
}

.stat-label {
  display: block;
  margin-top: 0.4rem;
  font-size: 1rem;
  color: var(--text-muted);
}

/* ==============================================================
     Projects
     -------------------------------------------------------------- */
/* Projects grid - EXACTLY 3 items per row */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(2rem, 4vw, 2.5rem);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
}

@media (max-width: 1200px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

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

  .project-links {
    flex-direction: column;
    align-items: stretch;
  }

  .project-link-btn {
    width: 100%;
  }
}

.project-card {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-card);
  border: 1.5px solid rgba(139, 92, 246, 0.2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(139, 92, 246, 0.15) 0%, 
    rgba(236, 72, 153, 0.1) 50%,
    rgba(59, 130, 246, 0.15) 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
  pointer-events: none;
}

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

.project-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 30px 60px rgba(139, 92, 246, 0.4);
  border-color: rgba(139, 92, 246, 0.5);
}

.project-media {
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, rgba(15, 16, 36, 0.8), rgba(18, 7, 43, 0.9));
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.project-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, 
    transparent 0%, 
    rgba(0, 0, 0, 0.3) 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

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

.project-media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.project-card:hover .project-media img {
  transform: scale(1.15) rotate(1deg);
}

.project-info {
  padding: clamp(1.6rem, 3.5vw, 2.4rem);
  display: grid;
  gap: 1rem;
  position: relative;
  z-index: 2;
  background: var(--bg-card);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.project-info h3 {
  font-size: clamp(1.3rem, 2.8vw, 1.65rem);
  margin: 0 0 0.5rem 0;
  font-weight: 700;
  background: linear-gradient(135deg, 
    #8b5cf6 0%, 
    #ec4899 50%, 
    #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.01em;
  line-height: 1.2;
  transition: transform 0.3s ease;
}

.project-card:hover .project-info h3 {
  transform: translateX(4px);
}

body[dir="rtl"] .project-card:hover .project-info h3 {
  transform: translateX(-4px);
}

.project-info p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.project-card:hover .project-info p {
  color: var(--text-primary);
}

/* Project Links */
.project-links {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.project-link-btn {
  justify-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.26), rgba(236, 72, 153, 0.2));
  border: 1.5px solid rgba(139, 92, 246, 0.28);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-width: 140px;
  text-align: center;
}

.project-link-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(236, 72, 153, 0.38));
  opacity: 0;
  transition: opacity 0.35s ease;
}

.project-link-btn:hover::before {
  opacity: 1;
}

.project-link-btn:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(236, 72, 153, 0.4));
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 32px rgba(139, 92, 246, 0.35);
  border-color: rgba(139, 92, 246, 0.55);
}

.project-link-btn[data-kind="website"] {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(34, 211, 238, 0.18));
  border-color: rgba(59, 130, 246, 0.35);
}

.project-link-btn[data-kind="website"]:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.45), rgba(34, 211, 238, 0.28));
  border-color: rgba(59, 130, 246, 0.6);
}

.project-link-btn[data-kind="app-store"] {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.3), rgba(99, 102, 241, 0.22));
  border-color: rgba(148, 163, 184, 0.35);
}

.project-link-btn[data-kind="google-play"] {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(59, 130, 246, 0.2));
  border-color: rgba(16, 185, 129, 0.35);
}

.project-link-btn[data-kind="google-play"]:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.45), rgba(59, 130, 246, 0.3));
  border-color: rgba(16, 185, 129, 0.6);
}

.project-link-btn span {
  position: relative;
  z-index: 1;
}

/* YouTube Shorts Styles - Vertical Reels Format */
.content-embed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
  gap: clamp(2rem, 4vw, 3rem);
  justify-content: center;
  padding: clamp(2rem, 4vw, 3rem) 0;
  max-width: 1200px;
  margin: 0 auto;
}

.youtube-short-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  border: 2px solid rgba(139, 92, 246, 0.2);
  box-shadow: 0 20px 50px rgba(15, 15, 20, 0.5);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.youtube-short-wrapper:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 30px 70px rgba(139, 92, 246, 0.45);
  border-color: rgba(139, 92, 246, 0.5);
}

.youtube-short {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  object-fit: cover;
  background: #000;
}

@media (max-width: 768px) {
  .content-embed-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1rem;
  }
  
  .youtube-short-wrapper {
    max-width: 100%;
    width: min(90vw, 400px);
    aspect-ratio: 9 / 16;
    margin: 0 auto;
  }
  
  .youtube-short {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}

/* Enhanced Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

[data-aos] {
  animation-duration: 0.8s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-aos="fade-up"] {
  animation-name: fadeInUp;
}

[data-aos="zoom-in"] {
  animation-name: scaleIn;
}

/* ==============================================================
     Art Gallery
     -------------------------------------------------------------- */
.art-gallery {
  columns: 3;
  column-gap: clamp(1rem, 3vw, 1.6rem);
}

.art-item {
  margin: 0 0 clamp(1rem, 3vw, 1.6rem);
  overflow: hidden;
  border-radius: var(--radius-md);
  position: relative;
  break-inside: avoid;
}

.art-item img {
  width: 100%;
  display: block;
  border-radius: inherit;
  transition: transform 0.6s ease, filter 0.4s ease;
}

.art-item:hover img {
  transform: scale(1.05);
  filter: saturate(1.1);
}

/* ==============================================================
     Contact Section
     -------------------------------------------------------------- */
.cta-row .btn {
  min-width: clamp(200px, 30vw, 240px);
}

/* ==============================================================
     Footer
     -------------------------------------------------------------- */
.site-footer {
  width: var(--container);
  margin: clamp(3rem, 6vw, 4rem) auto;
  padding: clamp(1.2rem, 3vw, 1.8rem) clamp(1.2rem, 3vw, 2.4rem);
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ==============================================================
     Toast Notifications
     -------------------------------------------------------------- */
.toast-container {
  position: fixed;
  top: clamp(1.2rem, 3vw, 1.8rem);
  right: clamp(1.2rem, 4vw, 2.5rem);
  display: grid;
  gap: 0.8rem;
  z-index: 5000;
}

.toast {
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius-sm);
  background: rgba(17, 24, 39, 0.75);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 42px rgba(15, 15, 20, 0.45);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.fade-out {
  opacity: 0;
  transform: translateY(-12px);
}

/* ==============================================================
     Terminal Easter Egg
     -------------------------------------------------------------- */
.terminal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.75);
  display: none;
  place-items: center;
  z-index: 6000;
  padding: 2rem;
}

.terminal-overlay.visible {
  display: grid;
}

.terminal {
  width: min(640px, 90vw);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 10, 18, 0.88);
  box-shadow: 0 25px 80px rgba(15, 15, 20, 0.65);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-title {
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(229, 231, 235, 0.8);
}

.terminal-body {
  padding: 1.2rem;
  overflow-y: auto;
  max-height: clamp(240px, 50vh, 320px);
  display: grid;
  gap: 0.6rem;
  font-family: "Fira Code", "Source Code Pro", monospace;
  font-size: 0.95rem;
  color: #d1d5db;
}

.terminal-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
}

.terminal-line .prompt {
  color: #34d399;
}

.terminal-line .path {
  color: #60a5fa;
}

.terminal-line .sign {
  color: #fbbf24;
}

.terminal-line.code {
  color: #f472b6;
}

.terminal-input {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-input input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: #e5e7eb;
  padding: 1rem 1.2rem;
  font-family: inherit;
  font-size: 0.95rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==============================================================
     Responsive Layouts
     -------------------------------------------------------------- */
@media (min-width: 1200px) {
  .hero-grid {
    grid-template-columns: 0.8fr minmax(360px, 400px);
    gap: clamp(1.5rem, 3vw, 2.5rem);
  }

  .hero-info {
    padding-right: clamp(0.8rem, 1.5vw, 1.2rem);
  }

  .hero-image-wrap {
    width: min(420px, 80vw);
    height: min(420px, 80vw);
  }

  body[dir="rtl"] .hero-image-wrap {
    width: min(440px, 82vw);
    height: min(440px, 82vw);
    margin-inline: 0 -3rem;
  }

  body[dir="rtl"] .hero-info {
    padding-right: 0;
    padding-left: clamp(0.8rem, 1.5vw, 1.2rem);
  }
}

@media (max-width: 1200px) {
  .art-gallery {
    columns: 2;
  }
}

@media (max-width: 480px) {
  :root {
    --font-hero: clamp(1.1rem, 9vw, 2.6rem);
    --font-typed: clamp(0.9rem, 5.8vw, 1.4rem);
  }

  .header-inner {
    gap: clamp(0.35rem, 2vw, 0.6rem);
  }

  .brand {
    font-size: clamp(1.05rem, 5vw, 1.25rem);
  }

  .header-actions {
    gap: clamp(0.35rem, 2vw, 0.55rem);
  }

  .header-actions .btn {
    padding: 0.55rem clamp(0.9rem, 5vw, 1.2rem);
    font-size: 0.92rem;
  }

  .icon-btn,
  .nav-toggle {
    width: 36px;
    height: 36px;
  }

  .nav-toggle {
    gap: 6px;
  }

  .nav-toggle span {
    width: 16px;
  }

  .hero-info {
    justify-items: center;
    text-align: center;
  }

  body[dir="rtl"] .hero-info {
    justify-items: center;
  }

  .hero-actions,
  body[dir="rtl"] .hero-actions,
  .social-links,
  body[dir="rtl"] .social-links {
    justify-content: center;
  }

  .hero-details,
  body[dir="rtl"] .hero-details {
    justify-items: center;
    text-align: center;
  }

  .hero-detail,
  body[dir="rtl"] .hero-detail {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 1024px) {
  .primary-nav,
  .nav-list {
    display: none;
  }

  .nav-toggle {
    display: flex;
    order: 3;
  }

  .header-actions {
    order: 2;
    gap: 0.6rem;
    margin-left: auto;
  }

  .site-header {
    backface-visibility: hidden;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: clamp(1.2rem, 3vw, 2rem);
  }

  .hero-info {
    padding-right: 0;
    padding-left: 0;
  }

  body[dir="rtl"] .hero-info {
    padding-right: 0;
    padding-left: 0;
  }

  .hero-media,
  body[dir="rtl"] .hero-media {
    justify-self: center;
  }

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

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

  .brand {
    white-space: normal;
  }
}

@media (max-width: 768px) {
  .section {
    margin-block: clamp(3.2rem, 8vw, 4.5rem);
    padding: clamp(1.8rem, 6vw, 2.6rem);
  }

  .hero-name {
    white-space: normal;
  }

  .hero-media {
    order: -1;
    justify-self: center;
  }

  .hero-image-wrap {
    width: min(360px, 85vw);
    height: min(360px, 85vw);
    margin: 0 auto clamp(1.4rem, 6vw, 2.2rem);
  }

  body[dir="rtl"] .hero-image-wrap {
    width: min(380px, 88vw);
    height: min(380px, 88vw);
    margin: 0 auto clamp(1.4rem, 6vw, 2.2rem);
  }

  .card-grid,
  .skills-grid,
  .projects-grid,
  .stats-grid,
  .cta-row,
  .content-embed-grid {
    grid-template-columns: 1fr;
  }

  .cta-row {
    grid-auto-flow: row;
  }

  .site-footer {
    width: calc(100% - 2.4rem);
  }
}

@media (max-width: 600px) {
  .site-header {
    padding: clamp(0.6rem, 3vw, 0.9rem) clamp(0.8rem, 4vw, 1rem);
    gap: 0.6rem;
  }

  .header-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: clamp(0.35rem, 2vw, 0.6rem);
  }

  .brand {
    font-size: clamp(1rem, 4.6vw, 1.2rem);
    letter-spacing: 0.04em;
  }

  .header-actions {
    margin-left: auto;
    flex-wrap: nowrap;
    gap: clamp(0.35rem, 2vw, 0.5rem);
  }

  .header-actions .btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.88rem;
  }

  .icon-btn,
  .nav-toggle {
    width: 34px;
    height: 34px;
  }

  .nav-toggle {
    gap: 6px;
  }

  .nav-toggle span {
    width: 16px;
  }

  #header-cv-btn .cv-label {
    display: none;
  }

  #header-cv-btn .cv-short {
    display: inline;
  }

  .hero-image-wrap {
    width: min(320px, 85vw);
    height: min(320px, 85vw);
    margin-inline: auto;
  }

  body[dir="rtl"] .hero-image-wrap {
    width: min(340px, 88vw);
    height: min(340px, 88vw);
  }

  /* Phone layout: keep each personal detail on a single line */
  .hero-details {
    justify-items: stretch; /* allow items to take full width */
    width: 100%;
  }

  .hero-detail {
    width: 100%;
    flex-direction: row !important; /* override smaller breakpoints */
    align-items: baseline;
    justify-content: space-between; /* label on one side, value on the other */
    gap: 0.5rem;
    text-align: left;
    flex-wrap: nowrap; /* stay on one line */
  }

  body[dir="rtl"] .hero-detail {
    flex-direction: row-reverse !important;
    text-align: right;
  }

  .hero-detail .detail-label {
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-primary);
  }

  .hero-detail .detail-value,
  .hero-detail .detail-link {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* handle long email/phone elegantly */
    max-width: 66%;
  }

  .art-gallery {
    columns: 1;
  }

  .toast-container {
    right: clamp(0.8rem, 4vw, 1.2rem);
  }

  .cursor-follower {
    display: none;
  }

  /* Mobile responsive for projects */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .project-card {
    max-width: 100%;
  }

  .project-card:hover {
    transform: translateY(-6px) scale(1.01);
  }

  /* Mobile responsive for YouTube Shorts */
  .content-embed-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .youtube-short-wrapper {
    max-width: 100%;
  }

  .youtube-short {
    height: 100%;
  }

  /* Reduce animation intensity on mobile */
  [data-aos] {
    animation-duration: 0.6s;
  }

  .project-card:hover .project-media img {
    transform: scale(1.05);
  }
}

/* ==============================================================
     Light Theme Tweaks
     -------------------------------------------------------------- */
body[data-theme="light"] .glass,
body[data-theme="light"] .site-header,
body[data-theme="light"] .site-footer,
body[data-theme="light"] .terminal {
  box-shadow: 0 18px 55px rgba(121, 134, 203, 0.2);
}

body[data-theme="light"] .icon-btn,
body[data-theme="light"] .social-link {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(136, 144, 200, 0.35);
}

body[data-theme="light"] .btn {
  color: #1f2937;
}

body[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.9);
  color: #111320;
  border-color: rgba(136, 144, 200, 0.35);
}

body[data-theme="light"] .terminal-overlay {
  background: rgba(240, 242, 255, 0.9);
}

/* Light theme comprehensive overrides */
body[data-theme="light"] .hero-typing {
  color: #334155;
}

body[data-theme="light"] .eyebrow {
  color: rgba(71, 85, 105, 0.7);
}

/* Cards & timeline look brighter in day mode */
body[data-theme="light"] .glass-card,
body[data-theme="light"] .timeline-item {
  background: var(--bg-card);
  border-color: rgba(136, 144, 200, 0.25);
  box-shadow: 0 12px 35px rgba(121, 134, 203, 0.22);
}

/* Mobile nav sheet in light mode */
body[data-theme="light"] .mobile-nav {
  background: rgba(255, 255, 255, 0.98);
  border: 1.5px solid rgba(139, 92, 246, 0.25);
  box-shadow: 0 20px 50px rgba(139, 92, 246, 0.2),
              0 0 0 1px rgba(139, 92, 246, 0.1);
}

body[data-theme="light"] .mobile-nav-link {
  color: #1e293b;
}

body[data-theme="light"] .mobile-nav-link:hover {
  background: rgba(139, 92, 246, 0.12);
  color: #0f172a;
}

/* Typographic tweaks */
body[data-theme="light"] .stat-value {
  color: #111320;
}

/* Subtle border for project link in light mode */
body[data-theme="light"] .project-link-btn {
  border-color: rgba(136, 144, 200, 0.35);
}

/* Avoid dark halo around portrait in light mode */
body[data-theme="light"] .hero-image-wrap img {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(245, 247, 255, 1) 100%
  );
}

/* Give header/footer a subtle glass background in light mode for readability */
body[data-theme="light"] .site-header,
body[data-theme="light"] .site-footer {
  background: var(--bg-card);
  border: 1px solid rgba(136, 144, 200, 0.25);
  border-radius: var(--radius-md);
}

/* Enhanced Light Mode Styles for Project Cards */
body[data-theme="light"] .project-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(139, 92, 246, 0.25);
  box-shadow: 0 10px 40px rgba(139, 92, 246, 0.15),
              0 4px 12px rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .project-card:hover {
  box-shadow: 0 30px 60px rgba(139, 92, 246, 0.25),
              0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: rgba(139, 92, 246, 0.4);
}

body[data-theme="light"] .project-card::before {
  background: linear-gradient(135deg, 
    rgba(139, 92, 246, 0.08) 0%, 
    rgba(236, 72, 153, 0.06) 50%,
    rgba(59, 130, 246, 0.08) 100%);
}

body[data-theme="light"] .project-info {
  background: linear-gradient(to bottom, 
    rgba(255, 255, 255, 0.98) 0%, 
    rgba(248, 250, 255, 0.95) 100%);
}

body[data-theme="light"] .project-info h3 {
  background: linear-gradient(135deg, 
    #7c3aed 0%, 
    #db2777 50%, 
    #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body[data-theme="light"] .project-info p {
  color: #475569;
}

body[data-theme="light"] .project-card:hover .project-info p {
  color: #1e293b;
}

/* Light mode timeline */
body[data-theme="light"] .timeline::before {
  background: linear-gradient(
    180deg,
    rgba(139, 92, 246, 0.4),
    rgba(59, 130, 246, 0.2)
  );
}

body[data-theme="light"] .timeline-item {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(139, 92, 246, 0.2);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.12);
}

body[data-theme="light"] .timeline-item::before {
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

/* Light mode YouTube shorts */
body[data-theme="light"] .youtube-short-wrapper {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(139, 92, 246, 0.25);
  box-shadow: 0 20px 50px rgba(139, 92, 246, 0.18);
}

body[data-theme="light"] .youtube-short-wrapper:hover {
  box-shadow: 0 30px 70px rgba(139, 92, 246, 0.28);
  border-color: rgba(139, 92, 246, 0.4);
}

/* Light mode play store button */
body[data-theme="light"] .play-store-btn {
  background: linear-gradient(135deg, 
    rgba(139, 92, 246, 0.2), 
    rgba(236, 72, 153, 0.15));
  border-color: rgba(139, 92, 246, 0.3);
  color: #1e293b;
}

body[data-theme="light"] .play-store-btn:hover {
  background: linear-gradient(135deg, 
    rgba(139, 92, 246, 0.35), 
    rgba(236, 72, 153, 0.25));
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 16px 32px rgba(139, 92, 246, 0.25);
}
