/* CSS Variables */
:root {
  --primary: #6e45e2;
  --secondary: #88d3ce;
  --accent: #ff7e5f;
  --dark: #0f0c1a;
  --darker: #090613;
  --light: #f5f5f7;
  --gray: #8a8a8e;
  --content-bg: rgba(15, 12, 26, 0.85);
  --card-bg: rgba(30, 27, 42, 0.6);
  --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  --border-radius: 16px;
}

/* Light Mode Variables */
body.light-mode {
  --dark: #f5f5f7;
  --darker: #e8e8ea;
  --light: #1a1a1a;
  --gray: #5a5a5e;
  --content-bg: rgba(255, 255, 255, 0.95);
  --card-bg: rgba(255, 255, 255, 0.8);
  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15);
}

/* Loading Screen */
.loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0f0c1a 0%, #1a1a2e 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

body.light-mode .loader-wrapper {
  background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ea 100%);
}

.loader-wrapper.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  text-align: center;
  animation: fadeInUp 0.8s ease;
}

.loader-logo {
  font-size: 5rem;
  color: var(--primary);
  margin-bottom: 20px;
  animation: pulse 2s ease-in-out infinite;
}

.loader-text {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 30px;
  letter-spacing: 5px;
  display: flex;
  justify-content: center;
  gap: 2px;
}

.loader-text span {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--accent), var(--secondary));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: wave 1.5s ease-in-out infinite, shimmer 3s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.1s);
  position: relative;
  text-shadow: 0 0 30px rgba(110, 69, 226, 0.5);
}

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

.loader-text span:nth-child(1) { --i: 0; }
.loader-text span:nth-child(2) { --i: 1; }
.loader-text span:nth-child(3) { --i: 2; }
.loader-text span:nth-child(4) { --i: 3; }
.loader-text span:nth-child(5) { --i: 4; }
.loader-text span:nth-child(6) { --i: 5; }
.loader-text span:nth-child(7) { --i: 6; }
.loader-text span:nth-child(8) { --i: 7; }
.loader-text span:nth-child(9) { --i: 8; }
.loader-text span:nth-child(10) { --i: 9; }
.loader-text span:nth-child(11) { --i: 10; }
.loader-text span:nth-child(12) { --i: 11; }

.loader-text .space {
  width: 15px;
  background: transparent;
  animation: none;
}

@keyframes wave {
  0%, 100% {
    transform: translateY(0px) scale(1) rotateZ(0deg);
    opacity: 1;
    filter: blur(0px);
  }
  25% {
    transform: translateY(-25px) scale(1.3) rotateZ(-5deg);
    opacity: 0.9;
    filter: blur(0.5px);
  }
  50% {
    transform: translateY(0px) scale(1) rotateZ(0deg);
    opacity: 1;
    filter: blur(0px);
  }
  75% {
    transform: translateY(-15px) scale(1.15) rotateZ(5deg);
    opacity: 0.95;
    filter: blur(0.3px);
  }
}

/* Add glow effect to letters */
.loader-text span::before {
  content: attr(data-text);
  position: absolute;
  filter: blur(10px);
  opacity: 0.5;
  animation: glow 1.5s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.1s);
}

@keyframes glow {
  0%, 100% {
    text-shadow: 0 0 10px var(--primary), 0 0 20px var(--accent);
  }
  50% {
    text-shadow: 0 0 20px var(--primary), 0 0 30px var(--accent), 0 0 40px var(--secondary);
  }
}

.loader-spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border: 4px solid rgba(110, 69, 226, 0.1);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-progress {
  width: 200px;
  height: 4px;
  background: rgba(110, 69, 226, 0.2);
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
}

.loader-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  animation: progress 2s ease-in-out;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes progress {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 180px;
  width: 50px;
  height: 50px;
  background: var(--card-bg);
  border: 1px solid rgba(110, 69, 226, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  border-color: var(--primary);
  box-shadow: 0 5px 20px rgba(110, 69, 226, 0.4);
}

.theme-toggle i {
  font-size: 1.2rem;
  position: absolute;
  transition: var(--transition);
}

.theme-toggle .fa-moon {
  color: var(--primary);
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle .fa-sun {
  color: #ffa500;
  opacity: 0;
  transform: rotate(180deg) scale(0);
}

body.light-mode .theme-toggle .fa-moon {
  opacity: 0;
  transform: rotate(-180deg) scale(0);
}

body.light-mode .theme-toggle .fa-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

@media (max-width: 768px) {
  .theme-toggle {
    top: 80px;
    right: 20px;
    width: 44px;
    height: 44px;
  }
  
  .loader-logo {
    font-size: 3.5rem;
  }
  
  .loader-text {
    font-size: 1.8rem;
    letter-spacing: 3px;
  }
  
  .loader-text span {
    animation: wave 1.5s ease-in-out infinite;
  }
  
  @keyframes wave {
    0%, 100% {
      transform: translateY(0px) scale(1);
    }
    50% {
      transform: translateY(-15px) scale(1.2);
    }
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--light);
  background-color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Globe Container */
#globeContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.4;
  pointer-events: none;
  will-change: opacity, transform;
  transition: opacity 0.5s ease;
}

body.light-mode #globeContainer {
  opacity: 0.15;
}

/* Language Switcher - Dropdown */
.lang-switcher {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid rgba(110, 69, 226, 0.2);
  color: var(--light);
  padding: 10px 16px;
  border-radius: 25px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: var(--transition);
  font-size: 0.95rem;
  min-width: 120px;
}

.lang-current:hover {
  border-color: var(--primary);
  background: var(--card-bg);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(110, 69, 226, 0.3);
}

.lang-current .fa-globe {
  color: var(--primary);
  font-size: 1.1rem;
}

.lang-current .fa-chevron-down {
  font-size: 0.8rem;
  margin-left: auto;
  transition: transform 0.3s ease;
}

.lang-switcher:hover .lang-current .fa-chevron-down {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: 60px;
  right: 0;
  background: var(--card-bg);
  border: 1px solid rgba(110, 69, 226, 0.2);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  padding: 8px;
  min-width: 150px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.lang-switcher:hover .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--gray);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
  text-align: left;
}

.lang-btn:hover {
  background: rgba(110, 69, 226, 0.15);
  color: var(--light);
  transform: translateX(5px);
}

.lang-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}

.lang-btn .fa-flag {
  font-size: 1rem;
  opacity: 0.7;
}

.lang-text {
  font-weight: 500;
}

/* Responsive for Language Switcher */
@media (max-width: 768px) {
  .lang-switcher {
    top: 80px;
    right: 10px;
  }
  
  .lang-current {
    padding: 8px 12px;
    font-size: 0.85rem;
    min-width: 100px;
  }
  
  .lang-dropdown {
    min-width: 130px;
  }
}

/* Top-left compact navigation */
#topNav {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  background: var(--card-bg);
  padding: 8px 12px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.04);
}

#topNav ul {
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: center;
}

#topNav a {
  color: var(--gray);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 999px;
  transition: var(--transition);
  display: inline-block;
}

#topNav a:hover,
#topNav a.active {
  background: var(--primary);
  color: var(--light);
}

/* Ensure top-left nav doesn't overlap on very small screens */
@media (max-width: 480px) {
  #topNav { left: 10px; top: 10px; padding: 6px 8px; }
  #topNav a { font-size: 0.8rem; padding: 5px 8px; }
}

.lang-btn {
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 15px;
  transition: var(--transition);
}
.lang-btn { font-size: 0.95rem; min-width: 44px; text-align: center; }

.lang-btn.active {
  background: var(--primary);
  color: var(--light);
}

/* Header Styles */
header {
  padding: 120px 5% 80px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.header-content {
  max-width: 800px;
  margin: 0 auto;
}

h1 {
  font-size: 5rem;
  font-weight: 800;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.subtitle {
  font-size: 1.5rem;
  color: var(--secondary);
  margin-bottom: 30px;
  font-weight: 300;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  background: linear-gradient(45deg, var(--primary), var(--accent));
  color: white;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow);
  border: none;
  cursor: pointer;
  margin: 10px;
}

.contact-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 30px -5px rgba(110, 69, 226, 0.4);
}

/* Main Content */
main {
  position: relative;
  max-width: 1200px;
  margin: 0 auto 80px;
  padding: 0 5%;
  z-index: 2;
}

section {
  margin-bottom: 80px;
  /* Make sections fully visible and disable any animations (override JS inline styles) */
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  display: block;
  visibility: visible !important;
}

/* Smooth fade-in that doesn't change layout (use opacity + transform only) */
.in-view {
  animation: fadeInUp 0.8s forwards;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), transparent);
  border-radius: 2px;
}

p {
  color: var(--gray);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 25px;
  max-width: 700px;
}

/* Skills Section */
.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.skill-category {
  background: var(--card-bg);
  padding: 25px;
  border-radius: var(--border-radius);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  display: block;
  width: 100%;
}

.skill-category:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 12px rgba(110, 69, 226, 0.2);
}

.skill-category h3 {
  color: var(--secondary);
  margin-bottom: 20px;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.skill-category ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Normalize list and nav sizing to avoid one list appearing larger */
ul, ol {
  font-size: 1rem;
  line-height: 1.6;
}

.skill-category li {
  position: relative;
  padding-left: 25px;
  color: var(--light);
  transition: var(--transition);
  min-height: 24px;
  display: flex;
  align-items: center;
}

.skill-category li:hover {
  color: var(--accent);
}

.skill-category li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--primary);
}

/* Statistics Section */
.stats-section {
  padding: 60px 5%;
  background: linear-gradient(135deg, rgba(110, 69, 226, 0.1) 0%, rgba(136, 211, 206, 0.1) 100%);
  margin: 40px 0;
  border-radius: var(--border-radius);
  position: relative;
  overflow: hidden;
}

.stats-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 50%, rgba(110, 69, 226, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.stat-box {
  background: var(--card-bg);
  padding: 40px 30px;
  border-radius: var(--border-radius);
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(110, 69, 226, 0.2);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}

.stat-box:hover::before {
  transform: scaleX(1);
}

.stat-box:hover {
  transform: translateY(-10px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(110, 69, 226, 0.3);
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 15px;
  line-height: 1;
  transition: transform 0.3s ease;
  will-change: transform;
  text-shadow: 0 0 30px rgba(110, 69, 226, 0.3);
}

.stat-number::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(110, 69, 226, 0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.stat-box:hover .stat-number::before {
  opacity: 1;
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-label {
  color: var(--gray);
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Responsive for Statistics */
@media (max-width: 768px) {
  .stats-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .stat-number {
    font-size: 2.5rem;
  }
  
  .stat-box {
    padding: 30px 20px;
  }
}

/* Expertise Section */
.expertise-section {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  padding: 4rem 2rem;
  margin: 2rem 0;
  border-radius: 15px;
}

.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.expertise-card {
  background: rgba(255, 255, 255, 0.05);
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.expertise-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
}

.expertise-card i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #6e45e2 0%, #88d3ce 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.expertise-card h3 {
  color: #fff;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.expertise-card p {
  color: #aaa;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Projects Section */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  margin-top: 40px;
}
/* Make grid rows consistent and allow cards to stretch to equal heights */
.projects-grid {
  grid-auto-rows: 1fr; /* each row will be at least the height needed and cards will stretch */
}

.featured-project {
  /* treat featured project like a normal card so it matches other cards */
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border: 1px solid rgba(110, 69, 226, 0.3);
  border-radius: 10px;
  overflow: hidden;
  grid-column: auto; /* don't span full width */
  padding: 0; /* let .project-info handle internal padding */
}

.featured-project .project-image {
  /* make featured card image visually match compact project cards */
  position: relative;
  height: 140px; /* same as other project cards */
  max-height: 200px;
  overflow: hidden;
  border-radius: var(--border-radius);
  border: none;
  margin: 0 18px 0 18px; /* keep some inner spacing so image doesn't touch card edges */
}

.project-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.featured-project:hover .project-screenshot {
  transform: scale(1.02);
}

@media (min-width: 768px) {

  .featured-project {
    /* keep featured project layout consistent with other cards on wider screens */
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    align-items: stretch;
  }

  .featured-project .project-image {
    /* same image sizing as other cards */
    height: 140px;
    border-radius: var(--border-radius);
    margin: 0;
    overflow: hidden;
  }

  .featured-project .project-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

.project-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow);
  border-color: rgba(110, 69, 226, 0.3);
}

.project-image {
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
  aspect-ratio: 16/9;
  width: 100%;
  object-fit: cover;
}

/* Project list consistency: prevent fading, fix card heights and image behavior */
.projects-grid {
  align-items: start; /* keep cards aligned */
}

.project-card {
  /* ensure visible (no fade) and predictable layout */
  opacity: 1 !important;
  animation: none !important;
  display: flex;
  flex-direction: column;
  min-height: 220px; /* compact card height */
  height: 100%; /* make card fill its grid cell */
  width: 100%;
  /* remove hard max-width to keep grid consistent across breakpoints */
}

.project-card .project-image {
  flex: 0 0 auto;
  height: 140px; /* image height tuned to your requested compact look */
  max-height: 200px; /* prevent an oversized source from expanding the card */
  overflow: hidden;
}

.project-card .project-image img,
.project-card .project-image .project-screenshot,
.project-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover; /* keep aspect and cover area */
}

/* Ensure screenshot images in project root or images/ are visible and constrained */
.project-image > img.project-screenshot {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  max-height: 200px;
  object-fit: cover;
}

/* If a source image inside images/ is huge, downscale it visually and limit its intrinsic size */
.project-image img[ src$="image.png" ],
.project-image img[alt*="CYBERSHIELD"],
.project-screenshot {
  max-width: 100%;
  max-height: 200px;
}

.project-card .project-info {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
}

.featured-project .project-info {
  padding: 18px; /* same padding for consistent internal layout */
}

/* keep title/description compact to enforce uniform card heights */
.project-title {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.project-desc {
  color: var(--gray);
  margin-bottom: 12px;
  font-size: 0.95rem;
  max-height: 3.6rem; /* roughly 2 lines */
  overflow: hidden;
}

.project-links {
  justify-content: flex-start;
}

/* Make featured project use compact card sizing like other project cards */
.featured-project .project-image {
  min-height: 140px;
  max-height: 200px;
}

.featured-project {
  max-width: 100%;
  width: 100%;
  min-height: auto; /* allow content to flow naturally */
}

.featured-project .project-image {
  height: 140px;
}

@media (max-width: 768px) {
  .project-card { min-height: 0; }
  .project-card .project-image { height: 200px; }
}

.project-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(15, 12, 26, 0.8), transparent);
}

/* Cap any image inside featured project to avoid overflow past menus */
.featured-project img.project-screenshot,
.project-card img.project-screenshot {
  max-height: 200px;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* project info layout and compact sizing */
.project-info {
  padding: 18px;
}

.project-card .project-title {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--light);
}

.project-card .project-desc {
  color: var(--gray);
  margin-bottom: 12px;
  font-size: 0.95rem;
  max-height: 3.6rem; /* limit description to ~2 lines */
  overflow: hidden;
}

/* featured project keeps larger title and more padding */
.featured-project .project-title {
  font-size: 1.4rem;
}

.project-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.project-security-note {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(110, 69, 226, 0.12);
  color: rgba(245, 245, 247, 0.85);
  font-size: 0.9rem;
  font-weight: 500;
}

.project-security-note i {
  color: var(--primary);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 28px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  color: var(--light);
  border-radius: 50px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(110,69,226,0.08);
  transition: var(--transition);
  margin-right: 18px;
}

.project-link:hover {
  background: linear-gradient(90deg, var(--accent) 0%, var(--primary) 100%);
  color: #fff;
  box-shadow: 0 6px 24px rgba(110,69,226,0.18);
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 25px;
  background: linear-gradient(45deg, var(--primary), var(--accent));
  color: var(--light);
  border-radius: 50px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
  margin-top: 15px;
  width: 100%;
  justify-content: center;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.download-btn i {
  font-size: 1.2rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 60px 5% 40px;
  position: relative;
  z-index: 2;
  background: linear-gradient(to bottom, transparent, var(--darker));
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-bottom: 30px;
}

.social-link {
  color: var(--gray);
  font-size: 1.5rem;
  transition: var(--transition);
}

.social-link:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

.ram-signature {
  margin: 20px 0;
}

.ram-logo {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(110, 69, 226, 0.5);
  margin-bottom: 15px;
  letter-spacing: 2px;
}

.ram-logo i {
  color: var(--accent);
  /* use logical margin so spacing works in LTR and RTL */
  margin-inline-end: 10px;
}

.copyright {
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.trademark {
  color: var(--gray);
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.8;
}

/* Improved footer layout: divider, spacing and responsive typography */
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 20px;
}

.footer-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  margin: 18px 0;
  border-radius: 2px;
}

.copyright {
  color: var(--gray);
  font-size: 0.95rem;
  margin: 6px 0 0;
}

.trademark {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  margin-top: 6px;
  line-height: 1.4;
}

/* make the RAM logo and signature aligned nicely */
.ram-signature {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}

.ram-logo {
  font-size: 1.8rem;
  margin-bottom: 0;
}

@media (max-width: 480px) {
  .copyright { font-size: 0.9rem; }
  .trademark { font-size: 0.85rem; }
  .download-btn { padding: 10px 18px; }
}

/* Professional two-column footer layout */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: center;
}

.footer-left {
  text-align: left;
}

.footer-right {
  text-align: right;
}

/* Responsive: stack the footer columns on small screens */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-right { text-align: center; }
  .footer-left { text-align: center; }
}

/* RTL support */
[dir="rtl"] .footer-left { text-align: right; }
[dir="rtl"] .footer-right { text-align: left; }

/* RTL Support */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .skill-category li {
  padding-right: 25px;
  padding-left: 0;
}

[dir="rtl"] .skill-category li::before {
  right: 0;
  left: auto;
}

/* Responsive Design */
/* Responsive Design */
@media (max-width: 1024px) {
  .expertise-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 3.5rem;
  }
  
  .subtitle {
    font-size: 1.2rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  section {
    margin-bottom: 60px;
  }
  
  .lang-switcher {
    top: 10px;
    right: 10px;
  }

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

  .expertise-card {
    padding: 1.5rem;
  }

  .expertise-card i {
    font-size: 2rem;
  }

  .expertise-card h3 {
    font-size: 1.2rem;
  }

  .expertise-section {
    padding: 2rem 1rem;
    margin: 1rem 0;
  }
}

/* Demo Modal Styles */
.demo-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  background: #0a0a0a;
  border: 1px solid #00ffff;
  border-radius: 8px;
  z-index: 1000;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.demo-modal-header {
  background: linear-gradient(90deg, #000033, #003366);
  padding: 1rem;
  border-bottom: 1px solid #00ffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.demo-modal-title {
  color: #00ffff;
  font-size: 1.2rem;
  margin: 0;
}

.demo-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 1rem;
  background: #111;
  border-bottom: 1px solid #333;
}

.stat-item {
  color: #fff;
  font-size: 0.9rem;
}

.stat-item.threats { color: #ff3333; }
.stat-item.processes { color: #ffff00; }
.stat-item.files { color: #00ff00; }
.stat-item.status { color: #00ffff; }

.demo-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.demo-button {
  padding: 0.8rem;
  border: none;
  border-radius: 4px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quick-scan { background: #0088ff; }
.deep-analysis { background: #ff4444; }
.custom-hunt { background: #ff8800; }
.nuclear { background: #cc0000; }
.guardian { background: #8800ff; }

.memory-analyze { background: #00aa44; }
.memory-optimize { background: #ff6600; }
.memory-monitor { background: #aa00ff; }

.demo-button:hover {
  transform: translateY(-2px);
  filter: brightness(120%);
}

.demo-results {
  padding: 1rem;
  background: #000;
  font-family: 'Consolas', monospace;
  color: #00ff00;
  height: 200px;
  overflow-y: auto;
  white-space: pre;
}

.demo-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 999;
}

.close-demo {
  background: none;
  border: none;
  color: #00ffff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* QR Modal Styling */
.demo-modal#qrModal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 95%;
  max-width: 500px;
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(110,69,226,0.12);
  z-index: 1001;
  padding: 0;
  overflow: visible;
}
.demo-modal-header {
  background: none;
  padding: 32px 24px 0 24px;
  border-bottom: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.demo-modal-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}
.close-demo {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: 10px;
}
.demo-modal .qr-demo-desc {
  color: var(--gray);
  margin-bottom: 24px;
  font-size: 1.1rem;
  text-align: center;
}
.demo-modal input.qr-input {
width: 100%; 
padding: 12px; 
border-radius: 8px; 
border: 1px solid var(--primary); 
margin-bottom: 16px; 
font-size: 1.5rem; 
background: rgba(255,255,255,0.13); 
border-radius: 50%; 
padding: 5px; 
margin-left: 0; 
margin-right: 0;
}
.demo-modal .qr-btn {
  background: linear-gradient(45deg, var(--primary), var(--accent));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 18px;
  transition: background 0.3s;
}
.demo-modal .qr-btn:hover {
  background: linear-gradient(45deg, var(--accent), var(--primary));
}
.demo-modal #qrcodeModal {
  margin: 18px auto;
  background: white;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(110,69,226,0.08);
  display: inline-block;
}
.demo-modal .qr-scan-section {
  margin-top: 32px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 18px;
}
.demo-modal #qr-reader-modal {
  width: 100%;
  margin: 0 auto;
}
.demo-modal .qr-result {
  margin-top: 12px;
  color: var(--primary);
  font-weight: 600;
  word-break: break-all;
}
.demo-modal .qr-footer {
  margin-top: 32px;
  color: var(--gray);
  font-size: 0.95rem;
  text-align: center;
  opacity: 0.8;
}
.demo-modal .qr-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: bold;
}
.img-compressor-modal {
  max-width: 640px;
  background: var(--card-bg);
  border: 1px solid rgba(110, 69, 226, 0.25);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.img-modal-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.img-compressor-desc {
  color: var(--gray);
  font-size: 1rem;
  text-align: center;
  line-height: 1.7;
}

.img-dropzone {
  border: 2px dashed rgba(110, 69, 226, 0.45);
  border-radius: 16px;
  padding: 36px 24px;
  text-align: center;
  background: rgba(15, 12, 26, 0.35);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--gray);
}

.img-dropzone i {
  font-size: 2.5rem;
  color: var(--primary);
}

.img-dropzone.drag-active,
.img-dropzone:hover {
  border-color: var(--accent);
  background: rgba(110, 69, 226, 0.15);
  color: var(--light);
}

.img-drop-note {
  font-size: 0.85rem;
  opacity: 0.7;
}

.img-modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.img-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 600;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.img-btn i {
  font-size: 1rem;
}

.img-btn.primary {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 12px 25px rgba(110, 69, 226, 0.2);
}

.img-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(110, 69, 226, 0.28);
}

.img-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--light);
  border: 1px solid rgba(110, 69, 226, 0.25);
}

.img-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.img-preview-wrapper,
.img-result-wrapper {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(110, 69, 226, 0.12);
}

.img-preview-wrapper h4,
.img-result-wrapper h4 {
  margin-bottom: 14px;
  color: var(--light);
  font-size: 1.1rem;
}

.img-preview {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 12, 26, 0.55);
  border-radius: 12px;
  border: 1px dashed rgba(110, 69, 226, 0.25);
  padding: 16px;
  text-align: center;
  color: var(--gray);
}

.img-preview-thumb {
  max-width: 100%;
  max-height: 200px;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
  object-fit: contain;
}

.img-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--light);
  font-size: 0.95rem;
}

.img-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px 14px;
}

.img-result-row .label {
  color: var(--gray);
  font-weight: 500;
}

.img-result-row .value {
  font-weight: 600;
  color: var(--accent);
}

.img-download {
  margin-top: 12px;
  text-align: center;
}

@media (max-width: 600px) {
  .img-modal-body {
    padding: 22px 18px;
  }

  .img-dropzone {
    padding: 28px 18px;
  }

  .img-result-row {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}
.demo-overlay#qrOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
}
@media (max-width: 600px) {
  .demo-modal#qrModal {
    max-width: 98vw;
    padding: 0;
  }
  .demo-modal-header {
    padding: 18px 8px 0 8px;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--primary), var(--accent));
  border-radius: 4px;
}
/* RAM Security Watermark Effect */
body::before {
  content: "RAM CYBER DEFENSE";
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-size: 0.9rem;
  color: rgb(1, 0, 3);
  font-weight: 700;
  letter-spacing: 1px;
  z-index: -1;
}
