:root {
  --bg-color: #2e1a17; /* Rich, deep brownish-red - warm & elegant */
  --second-bg-color: #4a2c24; /* Muted terracotta - adds depth */
  --text-color: #f8e1c4; /* Soft cream - warm and readable */
  --main-color: #ff8c00; /* Vivid orange - energetic and lively */
  --hover-color: #ffae42; /* Bright golden-orange - luxurious */
  --glow-color: rgba(255, 215, 0, 0.7); /* Golden glow - premium look */
  --accent-green: #b8ff66;
  --accent-gold: #ffd700;
  /* Header heights for safe offsets */
  --header-height-desktop: 86px; /* slightly reduced */
  --header-height-mobile: 64px;  /* slightly reduced */
  /* Extra offset for phone 'desktop mode' (landscape / wider screens with coarse pointer) */
  --header-height-phone-desktop-mode: 78px; /* trimmed down */
  /* Extra hero spacing to ensure heading clearance across modes */
  --hero-extra-space-desktop: 0.4rem; /* desktop can keep a small cushion */
  --hero-extra-space-mobile: 0rem;    /* remove extra space on phones */
  --hero-extra-space-phone-desktop: 0rem; /* remove extra space in phone 'desktop mode' */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  text-decoration: none;
  list-style: none;
  scroll-behavior: smooth;
}

/* Container and layout utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Responsive image utility */
.responsive-img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Spacing utilities */
.no-margin { margin: 0 !important; }
.small-margin { margin: 0.5rem 0; }
.medium-margin { margin: 1rem 0; }
.large-margin { margin: 2rem 0; }

.no-padding { padding: 0 !important; }
.small-padding { padding: 0.5rem; }
.medium-padding { padding: 1rem; }
.large-padding { padding: 2rem; }

/* Text alignment utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Project / Portfolio Specific Reusable Styles */
.project-card-title {
  color: var(--accent-green);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: .5px;
  margin-bottom: .35rem;
  transition: color .25s ease, text-shadow .25s ease;
}
.project-card-title:hover {
  color: #d4ff9d;
  text-shadow: 0 0 6px rgba(184,255,102,.6);
}

.tech-stack-line {
  color: #aaa;
  font-size: .85rem;
  line-height: 1.35;
}
.tech-stack-label {
  color: var(--accent-gold);
  font-weight: 600;
}

.includes-label { color: var(--accent-gold); }

.accent-gold { color: var(--accent-gold) !important; }
.accent-green { color: var(--accent-green) !important; }

.highlight-badge {
  color: var(--accent-gold);
  font-weight: 600;
  text-shadow: 0 0 6px rgba(255,215,0,.4);
}

/* New Project Card Layout Utilities (refactored from inline styles) */
.project-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  justify-items: center;
  align-items: stretch;
  will-change: transform;
  contain: layout style paint;
  transform: translateZ(0);
}

.project-card {
  background: rgba(20, 25, 45, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(138, 43, 226, 0.2);
  border-radius: 15px;
  overflow: hidden;
  width: 100%;
  max-width: 350px;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  box-shadow: 0 8px 32px rgba(10, 14, 39, 0.4);
  will-change: transform;
  contain: layout style paint;
}
.project-card:hover {
  transform: translateY(-8px) translateZ(0);
  box-shadow: 0 12px 40px rgba(138, 43, 226, 0.4), 0 0 30px rgba(0, 229, 255, 0.2);
  border-color: rgba(138, 43, 226, 0.5);
}

.project-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.project-card a.project-img-link {
  display: block;
  text-decoration: none;
  border: none;
  outline: none;
}

.project-card a.project-img-link:hover {
  text-decoration: none;
  opacity: 0.9;
}

.project-card-body {
  padding: 15px;
  text-align: center;
}

.project-desc { color: #ccc; font-size: 0.9rem; }
.project-meta { color: #aaa; font-size: 0.85rem; line-height: 1.4; }

.project-link {
  display: inline-block;
  font-size: 1.4rem;
  color: #fff;
  background: #ff004f;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}
.project-link:hover {
  background: #ff2569;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(255,0,79,0.35);
}

/* Modifier for wider buttons with icon + text */
.project-link--wide {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.2rem;
  padding: 8px 14px;
}

/* Container for multiple project action buttons */
.project-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
}
.project-links .project-link {
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
}
.project-links .project-link i { font-size: 1.1rem; }
@media (max-width: 520px) {
  .project-links { flex-direction: row; }
  .project-links .project-link { flex: 1 1 130px; text-align: center; }
}

body {
  color: var(--text-color);
  background: #0a0e27;
  overflow-x: hidden;
  position: relative;
}

/* Premium 3D Animated Gradient Background */
.bg-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1438 50%, #0d1b2a 100%);
  overflow: hidden;
}

/* Animated gradient orbs */
.bg-pattern::before,
.bg-pattern::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 15s ease-in-out infinite;
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.bg-pattern::before {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(138, 43, 226, 0.6) 0%, transparent 70%);
  top: -200px;
  left: -100px;
  animation: float 18s ease-in-out infinite, glow-purple 6s ease-in-out infinite;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.bg-pattern::after {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.5) 0%, transparent 70%);
  bottom: -150px;
  right: -100px;
  animation: float-reverse 20s ease-in-out infinite, glow-teal 7s ease-in-out infinite;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Additional gradient layers for depth */
@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(100px, -100px) scale(1.1);
  }
  50% {
    transform: translate(-50px, 100px) scale(0.9);
  }
  75% {
    transform: translate(150px, 50px) scale(1.05);
  }
}

@keyframes float-reverse {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(-120px, 80px) scale(0.95);
  }
  50% {
    transform: translate(80px, -120px) scale(1.1);
  }
  75% {
    transform: translate(-100px, -50px) scale(0.9);
  }
}

@keyframes glow-purple {
  0%, 100% {
    opacity: 0.3;
    filter: blur(80px);
  }
  50% {
    opacity: 0.5;
    filter: blur(100px);
  }
}

@keyframes glow-teal {
  0%, 100% {
    opacity: 0.35;
    filter: blur(80px);
  }
  50% {
    opacity: 0.6;
    filter: blur(90px);
  }
}

/* Content overlay for better text visibility */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 39, 0.25);
  backdrop-filter: blur(1px);
  z-index: -1;
  pointer-events: none;
}

/* Header Styles */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 10%;
  background: rgba(20, 20, 20, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.header.sticky {
  background: var(--bg-color);
  box-shadow: 0 0.1rem 1rem rgba(0, 0, 0, 0.2);
}

.logo {
  font-size: 25px;
  color: var(--text-color);
  font-weight: 600;
  animation: slideRight 1s ease forwards;
}

.navbar a {
  font-size: 18px;
  color: var(--text-color);
  font-weight: 500;
  margin-left: 35px;
  transition: 0.3s;
  position: relative;
}

.navbar a:hover,
.navbar a.active {
  color: var(--main-color);
  text-shadow: 0 0 10px var(--glow-color);
}

.navbar a::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--main-color);
  transition: 0.3s;
}

.navbar a:hover::before,
.navbar a.active::before {
  width: 100%;
}

/* Hide any menu icon elements */
#menu-icon,
.menu-icon,
.bx-menu {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Hide navbar on mobile devices */
@media (max-width: 768px) {
  .navbar {
    display: none !important;
  }
}

/* Mobile nav toggle base styles (hidden by default, enabled via media & pointer queries) */
.mobile-nav-toggle {
  position: relative;
  display: none; /* default hidden; shown conditionally */
  width: 40px; /* reduced width */
  height: 34px; /* reduced height */
  background: rgba(20,20,20,0.75);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border: 1.5px solid var(--main-color);
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 4px 6px;
  transition: all .3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35), 0 0 6px rgba(255,140,0,0.3);
  z-index: 1100; /* above header */
}

.mobile-nav-toggle:hover,
.mobile-nav-toggle:focus-visible {
  outline: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.55), 0 0 14px var(--glow-color);
  transform: translateY(-2px);
}

.mobile-nav-toggle-bar {
  width: 100%;
  height: 3px; /* thinner bars */
  background: var(--main-color);
  border-radius: 3px;
  transition: all .3s ease;
  box-shadow: 0 0 4px rgba(255,140,0,0.5);
}

/* Active (open) state transforms */
.mobile-nav-toggle.is-active .mobile-nav-toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.mobile-nav-toggle.is-active .mobile-nav-toggle-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.mobile-nav-toggle.is-active .mobile-nav-toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Menu (drawer / overlay) */
.mobile-menu {
  position: fixed;
  top: var(--header-height-mobile);
  right: 0;
  width: 78%;
  max-width: 320px;
  height: calc(100vh - var(--header-height-mobile));
  background: linear-gradient(160deg, rgba(20,20,20,0.95), rgba(34,34,34,0.92));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-left: 2px solid rgba(255,140,0,0.35);
  box-shadow: -4px 0 18px rgba(0,0,0,0.55), 0 0 12px rgba(255,140,0,0.25);
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.3rem 2.5rem;
  gap: .5rem;
  transform: translateX(105%);
  opacity: 0;
  visibility: hidden;
  transition: transform .55s cubic-bezier(.68,-0.55,.27,1.55), opacity .35s ease .1s, visibility .35s ease .1s;
  z-index: 1050;
  overflow-y: auto;
}
.mobile-menu::-webkit-scrollbar { width: 7px; }
.mobile-menu::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }
.mobile-menu::-webkit-scrollbar-thumb { background: var(--main-color); border-radius: 4px; }

.mobile-menu.is-open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
}

.mobile-menu a {
  display: block;
  padding: .85rem 1rem;
  border-radius: 10px;
  font-size: 1.05rem;
  color: var(--text-color);
  letter-spacing: .5px;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: background .3s ease, color .3s ease, transform .25s ease;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
}
.mobile-menu a:focus-visible { outline: 2px solid var(--main-color); outline-offset: 3px; }
.mobile-menu a:hover,
.mobile-menu a.active {
  background: linear-gradient(90deg, rgba(255,140,0,0.25), rgba(255,174,66,0.25));
  color: var(--accent-gold);
  box-shadow: 0 0 10px rgba(255,140,0,0.3);
  border-color: rgba(255,140,0,0.45);
  transform: translateX(-4px);
}

/* Subtle gradient overlay behind open menu (for focus) */
.mobile-menu::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,140,0,0.05), transparent 60%);
  pointer-events: none;
  border-radius: inherit;
}

/* Show toggle & mobile menu for small screens */
@media (max-width: 768px) {
  .mobile-nav-toggle { display: flex; }
  /* Ensure header spacing when toggle present */
  .header { gap: 1rem; }
}

/* Phone 'desktop mode' detection: wider but coarse pointer / no hover */
@media (hover: none) and (pointer: coarse) and (min-width: 769px) {
  .mobile-nav-toggle { display: flex; }
  .navbar { display: none !important; }
  
  /* Skills section fix - permanent padding override for phone desktop mode */
  .skills {
    padding-top: 6rem !important;
  }
  
  .mobile-menu { top: var(--header-height-phone-desktop-mode); height: calc(100vh - var(--header-height-phone-desktop-mode)); }
}

/* Home Section */
section {
  min-height: initial;
  padding: 5rem 5% 3rem;
  position: relative;
  overflow: hidden;
  max-width: 100vw;
  background: rgba(10, 14, 39, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Add decorative gradient overlays to sections */
section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

section > * {
  position: relative;
  z-index: 1;
}

/* First section (Home) needs more top padding due to header */
.home {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Ensure hero sits below fixed header on large screens */
  padding: 2rem 5% 3rem;
  padding-top: calc(var(--header-height-desktop) + 1rem + var(--hero-extra-space-desktop));
  position: relative;
  max-width: 100vw;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 27, 75, 0.9) 50%, rgba(88, 28, 135, 0.85) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeInUp 1s ease-out;
}

/* Desktop mode: Increase top padding for better visual separation */
@media (min-width: 769px) {
  .home {
    /* Desktop/site preview in mobile browsers */
    padding-top: calc(var(--header-height-desktop) + 1rem + var(--hero-extra-space-desktop));
  }
}

/* Other sections should have consistent but smaller spacing */
.about, .skills, .experience, .projects, .achievements, .contact {
  min-height: initial;
  padding: 4rem 5% 3rem;
  max-width: 100vw;
  margin: 0 auto;
  background: rgba(10, 14, 39, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  /* Performance optimization */
  content-visibility: auto;
  contain: layout style paint;
}

.home::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.03) 0%, rgba(0, 229, 255, 0.03) 100%);
  z-index: 0;
  pointer-events: none;
}

.home-content {
  max-width: 600px;
  position: relative;
  z-index: 10; /* keep hero above its overlay but below header */
  animation: fadeInUp 1s ease-out 0.3s both;
}

.home-content h1 {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.2;
  margin: 10px 0;
  animation: slideInLeft 1s ease-out 0.5s both;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.home-content h3 {
  font-size: 32px;
  font-weight: 700;
  color: var(--main-color);
  animation: slideInLeft 1s ease-out 0.7s both;
}

.home-content h3 span {
  color: var(--hover-color);
  text-shadow: 0 0 10px var(--glow-color);
}

.home-content p {
  font-size: 16px;
  margin: 20px 0 15px;
  animation: fadeInUp 1s ease-out 0.9s both;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* OLD .home-sci REMOVED - Using .social-icons instead */

.btn-box {
  display: inline-block;
  padding: 12px 28px;
  background: var(--main-color);
  border-radius: 40px;
  font-size: 16px;
  color: var(--bg-color);
  letter-spacing: 1px;
  font-weight: 600;
  transition: 0.5s;
  box-shadow: 0 0 10px var(--main-color);
  margin-right: 15px;
  border: none;
  cursor: pointer;
}

.btn-box:hover {
  background: var(--hover-color);
  color: var(--bg-color);
  box-shadow: 0 0 20px var(--glow-color);
  transform: translateY(-5px);
}

/* Premium golden active/focus state for buttons */
.btn-box:active,
.btn-box:focus-visible,
.btn-download:active,
.btn-download:focus-visible,
.project-link:active,
.project-link:focus-visible,
.project-link--wide:active,
.project-link--wide:focus-visible {
  outline: none;
  background: linear-gradient(135deg, #ffae42 0%, #ffd700 45%, #ff8c00 100%);
  color: #1a120e;
  box-shadow: 0 0 24px rgba(255,215,0,0.8), 0 0 10px rgba(255,174,66,0.6);
  border-color: #ffd700;
  transform: translateY(-3px) scale(1.02);
}

/* Button and Social Icons Wrapper */
.btn-social-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 25px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--main-color);
  color: var(--bg-color);
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
  min-width: 160px;
  border: 2px solid var(--main-color);
}

.btn-download:hover {
  background: var(--hover-color);
  border-color: var(--hover-color);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 174, 66, 0.4);
}

.btn-download i {
  font-size: 18px;
}

/* Social Media Icons */
.social-icons {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-left: 0 !important;
}

.social-icons a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 45px !important;
  height: 45px !important;
  border-radius: 50% !important;
  background: rgba(255, 140, 0, 0.1) !important;
  border: 2px solid var(--main-color) !important;
  transition: all 0.3s ease !important;
  text-decoration: none !important;
  box-shadow: 0 0 10px rgba(255, 140, 0, 0.3) !important;
}

.social-icons a:hover {
  background: var(--main-color) !important;
  transform: scale(1.15) translateY(-3px) !important;
  box-shadow: 0 5px 20px var(--glow-color) !important;
}

.social-icons a i {
  font-size: 24px !important;
  color: var(--main-color) !important;
  transition: all 0.3s ease !important;
  font-weight: 600 !important;
}

.social-icons a:hover i {
  color: var(--bg-color) !important;
}

/* Specific hover colors for each social platform */
.social-icons a:hover[href*="github"] {
  background: #ffffff;
  border-color: #ffffff;
}

.social-icons a:hover[href*="github"] i {
  color: #181717;
}

.social-icons a:hover[href*="linkedin"] {
  background: #0077b5;
  border-color: #0077b5;
}

.social-icons a:hover[href*="linkedin"] i {
  color: #ffffff;
}

.social-icons a:hover[href*="mailto"] {
  background: #ea4335;
  border-color: #ea4335;
}

.social-icons a:hover[href*="mailto"] i {
  color: #ffffff;
}

.social-icons a:hover[href*="wa.me"] {
  background: #25d366;
  border-color: #25d366;
}

.social-icons a:hover[href*="wa.me"] i {
  color: #ffffff;
}

.home-img,
.profile-img {
  position: relative;
  z-index: 10;
  animation: floatImage 2s ease-in-out infinite;
  margin-left: 40px;
}

.home-img img,
.profile-img img {
  width: auto;
  max-width: 350px;
  max-height: 350px;
  min-width: 280px;
  height: auto;
  object-fit: cover;
  border-radius: 20px;
  border: 5px solid var(--main-color);
  box-shadow: 0 0 30px var(--glow-color), 0 10px 40px rgba(0, 238, 255, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.home-img img:hover,
.profile-img img:hover {
  transform: translateY(-10px);
  box-shadow: 0 0 40px var(--glow-color), 0 15px 50px rgba(0, 238, 255, 0.5);
}

/* About Section */
.about {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4rem;
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.2) 0%, rgba(37, 99, 235, 0.15) 25%, rgba(59, 130, 246, 0.12) 50%, rgba(6, 182, 212, 0.18) 75%, rgba(8, 145, 178, 0.22) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  /* Make About section span full viewport width */
  width: 100%;
  max-width: none;
  margin: 0;
  animation: slideInLeft 0.8s ease-out;
  will-change: transform, opacity;
  transform: translateZ(0);
}

.about-img img {
  width: 35vw;
  max-width: 450px;
  min-width: 250px;
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.5), 0 10px 40px rgba(37, 99, 235, 0.4), 0 5px 20px rgba(6, 182, 212, 0.3);
  animation: zoomIn 0.8s ease-out 0.3s both;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.about-img img:hover {
  transform: scale(1.05) translateZ(0);
  box-shadow: 0 0 45px rgba(59, 130, 246, 0.7), 0 15px 50px rgba(37, 99, 235, 0.6), 0 8px 30px rgba(6, 182, 212, 0.5);
}

/* Utility: show only on desktop / laptop (hide on phones including phone 'desktop mode') */
.desktop-only { display: none !important; }
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
  .desktop-only { display: block !important; }
  
  /* PC/Laptop: Align Download Resume button and social icons exactly under paragraph */
  .home .btn-social-wrapper {
    justify-content: flex-start !important;
    margin-left: 0 !important;
    max-width: 600px; /* Match home-content max-width */
    width: 100%;
    text-align: left;
  }
  
  /* Ensure Download Resume button aligns to left */
  .home .btn-box {
    margin-right: 15px;
  }
}

/* Ensure About image remains visible and centered on tablets/mobiles */
@media (max-width: 1023px) {
  .about-img {
    display: block;
    margin: 0 auto;
  }
}

.heading {
  font-size: 45px;
  text-align: center;
  margin-bottom: 50px;
  animation: fadeInUp 0.6s ease-out;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 255, 255, 0.3), 0 0 15px rgba(255, 140, 0, 0.4);
  letter-spacing: 1px;
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.heading span {
  color: var(--main-color);
  font-weight: 800;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.9), 0 0 20px var(--glow-color), 0 0 30px var(--glow-color), 0 0 40px rgba(255, 140, 0, 0.6);
  animation: glow 2s ease-in-out infinite alternate;
  filter: brightness(1.2) contrast(1.1);
}

/* Glow animation for headings */
@keyframes glow {
  0% {
    text-shadow: 0 0 10px var(--glow-color);
  }
  100% {
    text-shadow: 0 0 20px var(--glow-color), 0 0 30px var(--glow-color);
  }
}

.about-content h2 {
  text-align: left;
  line-height: 0;
  margin-top: 0px;
  animation: fadeInUp 0.6s ease-out 0.15s both;
  will-change: transform, opacity;
  transform: translateZ(0);
}

.about-content h3 {
  font-size: 26px;
  color: var(--main-color);
  margin-top: 0px;
  margin-bottom: 10px;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.about-content p {
  font-size: 16px;
  margin: 2rem 0 1rem;
  animation: fadeInUp 0.8s ease-out 0.6s both;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Skills Section */
.skills {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.2) 50%, rgba(4, 120, 87, 0.25) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: zoomIn 1s ease-out;
  padding-top: 5rem !important;
}

/* New Skills Grid (Recruiter-Optimized) - CENTERED */
.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  justify-items: center; /* Center grid items */
}

.skills-box {
  background: linear-gradient(135deg, rgba(20, 25, 45, 0.7), rgba(25, 30, 55, 0.6));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(138, 43, 226, 0.2);
  border-radius: 14px;
  padding: 1.5rem 1.2rem 1.2rem;
  box-shadow: 0 8px 32px rgba(10, 14, 39, 0.4);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  width: 100%; /* Full width within grid cell */
  max-width: 350px; /* Maximum width for consistency */
  text-align: center; /* Center content */
}

.skills-box:hover {
  transform: translateY(-4px);
  border-color: rgba(249, 115, 22, 0.5);
  box-shadow: 0 12px 36px rgba(249, 115, 22, 0.15), 0 0 20px rgba(138, 43, 226, 0.1);
}

.skills-box-head {
  display: flex;
  align-items: center;
  justify-content: center; /* Center header content */
  gap: .8rem;
  margin-bottom: 1.2rem;
}

.skills-box-head i {
  font-size: 1.6rem;
  color: var(--main-color);
}

.skills-box-head h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: .3px;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  justify-content: center; /* Center icons */
  align-items: center; /* Vertically align icons */
}

.skills-list img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 7px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: block; /* Ensure proper centering */
  content-visibility: auto;
  contain-intrinsic-size: 44px 44px;
  will-change: transform;
  transform: translateZ(0);
}

.skills-list img:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 18px rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.40);
}

.skills-list img.badge {
  height: 30px;
  width: auto;
  padding: 2px 4px;
  background: transparent;
  border: none;
  border-radius: 6px;
}

.skills-list img.invert-on-dark {
  filter: invert(1) brightness(1.05) saturate(0.85);
  background: transparent;
  border: none;
}

/* Divider style for merged Databases & Programming Languages card */
.skills-divider {
  border: 0;
  height: 1px;
  background: linear-gradient(to right, rgba(255,255,255,0.12), rgba(255,255,255,0.55), rgba(255,255,255,0.12));
  margin: 0.8rem auto 1rem;
  width: 85%;
  position: relative;
}

@media (max-width: 640px) {
  .skills-container {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 1.2rem;
  }
  
  .skills-box {
    max-width: 100%; /* Full width on mobile */
  }
  
  .skills-list {
    gap: .7rem;
    justify-content: center; /* Keep centered on mobile */
  }
  
  .skills-list img {
    width: 40px;
    height: 38px;
    padding: 5px;
  }
}

/* Mobile centering for skills headings and icon grids */
@media (max-width: 768px) {
  .skills-box-head {
    justify-content: center;
    text-align: center;
  }
  .skills-box-head h3 { text-align: center; }
  .skills-list {
    justify-content: center;
  }
}

/* Experience Section */
.experience {
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.15) 0%, rgba(249, 115, 22, 0.2) 50%, rgba(194, 65, 12, 0.25) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: slideInRight 1s ease-out;
}

.timeline {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.timeline::after {
  content: "";
  position: absolute;
  width: 6px;
  background: var(--main-color);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -3px;
  border-radius: 10px;
  box-shadow: 0 0 10px var(--glow-color);
}

.timeline-container {
  padding: 10px 40px;
  position: relative;
  background-color: inherit;
  width: 50%;
}

.timeline-container::after {
  content: "";
  position: absolute;
  width: 25px;
  height: 25px;
  right: -17px;
  background-color: var(--bg-color);
  border: 4px solid var(--main-color);
  top: 15px;
  border-radius: 50%;
  z-index: 1;
  box-shadow: 0 0 10px var(--glow-color);
}

.left {
  left: 0;
}

.right {
  left: 50%;
}

.left::before {
  content: " ";
  height: 0;
  position: absolute;
  top: 22px;
  width: 0;
  z-index: 1;
  right: 30px;
  border: medium solid var(--main-color);
  border-width: 10px 0 10px 10px;
  border-color: transparent transparent transparent var(--main-color);
}

.right::before {
  content: " ";
  height: 0;
  position: absolute;
  top: 22px;
  width: 0;
  z-index: 1;
  left: 30px;
  border: medium solid var(--main-color);
  border-width: 10px 10px 10px 0;
  border-color: transparent var(--main-color) transparent transparent;
}

.right::after {
  left: -16px;
}

.timeline-content {
  padding: 20px 30px;
  background: rgba(20, 25, 45, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(138, 43, 226, 0.2);
  position: relative;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(10, 14, 39, 0.4);
  transition: 0.3s;
}

.timeline-content:hover {
  box-shadow: 0 12px 40px rgba(138, 43, 226, 0.3), 0 0 25px rgba(0, 229, 255, 0.15);
  border-color: rgba(138, 43, 226, 0.4);
}

.timeline-content h2 {
  color: var(--main-color);
  margin-bottom: 10px;
}

.timeline-content h3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: var(--hover-color);
}

.timeline-content p {
  margin-bottom: 10px;
}

.timeline-content ul {
  padding-left: 20px;
}

.timeline-content ul li {
  margin-bottom: 8px;
  position: relative;
}

.timeline-content ul li::before {
  content: "▹";
  position: absolute;
  left: -20px;
  color: var(--main-color);
}

/* Projects Section */
.projects {
  background: linear-gradient(135deg, rgba(67, 56, 202, 0.15) 0%, rgba(79, 70, 229, 0.2) 50%, rgba(99, 102, 241, 0.15) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeInUp 1s ease-out 0.2s both;
}

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

.project-box {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  transition: 0.5s;
}

.project-box:hover {
  transform: translateY(-10px);
  box-shadow: 0 0 20px var(--glow-color);
}

.project-box img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: 0.5s;
}

.project-box:hover img {
  transform: scale(1.1);
}

.project-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0, 0, 0, 0.1), var(--main-color));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 40px;
  transform: translateY(100%);
  transition: 0.5s;
}

.project-box:hover .project-layer {
  transform: translateY(0);
}

.project-layer h4 {
  font-size: 24px;
  color: #fefae0;
  margin-bottom: 10px;
}

.project-layer p {
  font-size: 16px;
  color: #fefae0;
  margin-bottom: 20px;
}

.project-layer a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 50px;
  height: 50px;
  background: var(--bg-color);
  border-radius: 50%;
  color: var(--main-color);
  font-size: 20px;
  transition: 0.3s;
}

.project-layer a:hover {
  background: var(--hover-color);
  color: var(--bg-color);
  transform: rotate(360deg);
  box-shadow: 0 0 10px var(--glow-color);
}

/* Achievements Section */
.achievements {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(219, 39, 119, 0.2) 50%, rgba(190, 24, 93, 0.25) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: zoomIn 1s ease-out 0.3s both;
}

.achievements-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.achievement-box {
  background: rgba(20, 25, 45, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(138, 43, 226, 0.2);
  padding: 30px;
  border-radius: 20px;
  text-align: center;
  transition: 0.5s;
  box-shadow: 0 8px 32px rgba(10, 14, 39, 0.4);
}

.achievement-box:hover {
  border-color: rgba(138, 43, 226, 0.5);
  transform: translateY(-10px);
  box-shadow: 0 12px 40px rgba(138, 43, 226, 0.3), 0 0 25px rgba(0, 229, 255, 0.15);
}

.achievement-box i {
  font-size: 40px;
  color: var(--main-color);
  margin-bottom: 20px;
}

.achievement-box h3 {
  font-size: 20px;
  margin-bottom: 15px;
}

.achievement-box p {
  font-size: 14px;
}

/* Contact Section */
.contact {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(14, 165, 233, 0.2) 50%, rgba(2, 132, 199, 0.25) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeInUp 1s ease-out 0.4s both;
}

.contact h2 {
  margin-bottom: 50px;
}

.contact form {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.contact form .input-box {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.contact form .input-box input,
.contact form textarea {
  width: 100%;
  padding: 15px;
  font-size: 16px;
  color: var(--text-color);
  background: rgba(20, 25, 45, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 10px;
  margin: 10px 0;
  border: 1px solid rgba(6, 182, 212, 0.3);
  outline: none;
  transition: 0.3s;
}

.contact form .input-box input:focus,
.contact form textarea:focus {
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.5);
  border-color: rgba(6, 182, 212, 0.6);
  background: rgba(20, 25, 45, 0.7);
}

.contact form .input-box input {
  width: 49%;
}

.contact form textarea {
  resize: none;
  height: 200px;
}

.contact form .btn-box {
  margin-top: 20px;
  cursor: pointer;
  border: none;
}

.contact-info {
  margin-top: 50px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--second-bg-color);
  padding: 20px;
  border-radius: 10px;
  transition: 0.3s;
}

.contact-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 20px var(--glow-color);
}

.contact-item i {
  font-size: 30px;
  color: var(--main-color);
}

.contact-details h3 {
  font-size: 18px;
  margin-bottom: 5px;
}

.contact-details p {
  font-size: 14px;
  color: #ccc;
}

.contact-details a {
  text-decoration: none;
  color: #ccc;
  cursor: pointer;
  transition: color 0.3s ease;
}

.contact-details a:hover {
  color: var(--main-color);
  text-decoration: none;
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 20px 10%;
  background: var(--second-bg-color);
}

.footer-text p {
  font-size: 16px;
}

.footer-iconTop a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  background: var(--main-color);
  border-radius: 50%;
  transition: 0.5s;
}

.footer-iconTop a:hover {
  box-shadow: 0 0 20px var(--glow-color);
  transform: translateY(-5px);
}

.footer-iconTop a i {
  font-size: 24px;
  color: var(--bg-color);
}

/* Animations */
@keyframes slideRight {
  0% {
    transform: translateX(-100px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideLeft {
  0% {
    transform: translateX(100px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

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

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

@keyframes floatImage {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-24px);
  }
  100% {
    transform: translateY(0);
  }
}

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

/* Premium Section Entry Animations */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(60px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  0% {
    opacity: 0;
    transform: translateX(-80px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translateX(80px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes zoomIn {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Stagger animation for child elements */
.project-card,
.skills-box,
.achievement-box,
.timeline-container {
  animation: fadeInUp 0.6s ease-out backwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.15s; }
.project-card:nth-child(3) { animation-delay: 0.2s; }
.project-card:nth-child(4) { animation-delay: 0.25s; }
.project-card:nth-child(5) { animation-delay: 0.3s; }
.project-card:nth-child(6) { animation-delay: 0.35s; }

.skills-box:nth-child(1) { animation-delay: 0.1s; }
.skills-box:nth-child(2) { animation-delay: 0.2s; }
.skills-box:nth-child(3) { animation-delay: 0.3s; }
.skills-box:nth-child(4) { animation-delay: 0.4s; }
.skills-box:nth-child(5) { animation-delay: 0.5s; }
.skills-box:nth-child(6) { animation-delay: 0.6s; }
.skills-box:nth-child(7) { animation-delay: 0.7s; }
.skills-box:nth-child(8) { animation-delay: 0.8s; }

.achievement-box:nth-child(1) { animation-delay: 0.1s; }
.achievement-box:nth-child(2) { animation-delay: 0.2s; }
.achievement-box:nth-child(3) { animation-delay: 0.3s; }
.achievement-box:nth-child(4) { animation-delay: 0.4s; }

.timeline-container:nth-child(1) { animation-delay: 0.1s; }
.timeline-container:nth-child(2) { animation-delay: 0.3s; }

/* Breakpoints */
@media (max-width: 1200px) {
  html {
    font-size: 90%;
  }
}

@media (max-width: 991px) {
  .header {
    padding: 15px 5%;
  }

  section {
    padding: 3rem 5% 2rem;
  }

  .home {
    min-height: initial !important;
    padding: 1rem 5% 1rem !important;
    flex-direction: column;
    text-align: center;
    gap: 1rem !important;
  }

  .about, .skills, .experience, .projects, .achievements, .contact {
    padding: 3rem 5% 2rem;
  }

  .footer {
    padding: 15px 5%;
  }

  /* Improve home content spacing on tablets */
  .home-content {
    max-width: 100%;
    margin-bottom: 1rem;
  }

  .home-content h1 {
    font-size: 3rem;
    margin: 0.5rem 0;
  }

  .home-content h3 {
    font-size: 1.8rem;
    margin: 0.5rem 0;
  }

  .home-content p {
    font-size: 1rem;
    margin: 1rem 0;
    line-height: 1.6;
  }

  .home-img img {
    width: 60vw;
    max-width: 300px;
    min-width: 220px;
    border-radius: 18px;
  }

  /* Optimize about section layout */
  .about {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .about-content {
    text-align: center !important;
  }

  .about-content h2,
  .about-content h3,
  .about-content p {
    text-align: center !important;
  }

  .about-img img {
    width: 50vw;
    max-width: 350px;
  }

  /* Improve skills grid */
  .skills-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  section {
    padding: 2rem 3% 1.5rem;
  }

  .home {
    min-height: 100vh;
    flex-direction: column;
    text-align: center;
    /* Mobile/phone: only clear the fixed header */
    padding: calc(var(--header-height-mobile) + 0rem + var(--hero-extra-space-mobile)) 5% 3rem !important;
    gap: 1.5rem;
    justify-content: flex-start;
  }

  .about, .skills, .experience, .projects, .achievements, .contact {
    padding: 2rem 3% 1.5rem;
  }
  
  .skills {
    padding: 3.5rem 3% 1.5rem !important;
  }

  .home-content {
    margin-top: 0rem; /* remove extra vertical gap under header */
    max-width: 100%;
  }

  .home-content h3:first-child {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
  }

  .home-content h1 {
    font-size: 2.5rem;
    margin: 0.5rem 0;
    line-height: 1.1;
    font-weight: 700;
  }

  .home-content h3:nth-child(3) {
    font-size: 1.2rem;
    margin: 0.5rem 0;
  }

  .home-content p {
    font-size: 0.9rem;
    margin: 1rem 0 1.5rem;
    line-height: 1.6;
    max-width: 100%;
  }

  .home-img,
  .profile-img {
    margin-left: 0;
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
  }

  .home-img img,
  .profile-img img {
    width: 70vw;
    max-width: 320px;
    max-height: 380px;
    min-width: 200px;
    margin: 0 auto;
    border-radius: 16px;
  }

  .about {
    flex-direction: column-reverse;
    text-align: center;
    gap: 1.5rem;
  }

  .about-img img {
    width: 65vw;
    max-width: 280px;
    margin-top: 1rem;
  }

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

  /* Optimize heading spacing */
  .heading {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    font-weight: 700;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9), 0 0 25px rgba(255, 255, 255, 0.3), 0 0 15px rgba(255, 140, 0, 0.5);
  }
  
  .heading span {
    font-weight: 800;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 1), 0 0 20px var(--glow-color), 0 0 30px var(--glow-color), 0 0 40px rgba(255, 140, 0, 0.7);
  }

  /* Center buttons and social icons on mobile */
  .btn-social-wrapper {
    gap: 20px;
    margin-top: 2rem;
    justify-content: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100%;
  }

  .btn-download {
    padding: 12px 20px;
    font-size: 14px;
    min-width: 150px;
    margin: 0 auto 15px auto !important;
    display: block !important;
    text-align: center !important;
  }

  .social-icons {
    gap: 15px;
    margin: 0 auto !important;
    justify-content: center !important;
    display: flex !important;
    align-items: center !important;
    width: 100%;
  }

  .social-icons a {
    width: 42px;
    height: 42px;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .social-icons a i {
    font-size: 22px;
  }
}

/* Additional mobile styles continuation */
@media (max-width: 768px) {
  .home-content h3 {
    font-size: 1.6rem;
  }

  .home-img img {
    width: 75vw;
    max-width: 260px;
    min-width: 200px;
    margin-top: 1rem;
    border-radius: 15px;
  }

  .about {
    flex-direction: column-reverse;
    text-align: center;
    gap: 1.5rem;
  }

  .about-content {
    text-align: center !important;
  }

  .about-content h2,
  .about-content h3,
  .about-content p {
    text-align: center !important;
  }

  .about-img img {
    width: 65vw;
    max-width: 280px;
    margin-top: 1rem;
  }

  .timeline::after {
    left: 31px;
  }

  .timeline-container {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }

  .timeline-container::before {
    left: 60px;
    border: medium solid var(--main-color);
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--main-color) transparent transparent;
  }

  .left::after,
  .right::after {
    left: 15px;
  }

  .right {
    left: 0%;
  }

  .contact form .input-box input {
    width: 100%;
  }
}

@media (max-width: 576px) {
  html {
    font-size: 85%;
  }

  section {
    padding: 1.5rem 3% 1rem;
  }
  
  .skills {
    padding: 3rem 3% 1rem !important;
  }

  .home {
    min-height: 80vh;
    /* maintain top clearance for very small devices */
    padding: calc(var(--header-height-mobile) + 0rem + var(--hero-extra-space-mobile)) 3% 1rem !important;
    gap: 1rem;
  }

  .about, .skills, .experience, .projects, .achievements, .contact {
    padding: 1.5rem 3% 1rem;
  }

  .header {
    padding: 12px 3%;
  }

  .logo {
    font-size: 1.3rem;
  }

  .home-content h1 {
    font-size: 1.8rem;
    margin: 0.2rem 0;
  }

  .home-content h3 {
    font-size: 1.2rem;
    margin: 0.2rem 0;
  }

  .home-content p {
    font-size: 0.9rem;
    margin: 0.6rem 0;
  }

  .home-img img {
    width: 80vw;
    max-width: 240px;
    min-width: 180px;
    border-radius: 14px;
  }

  .btn-box {
    padding: 8px 16px;
    font-size: 0.85rem;
    margin-top: 0.8rem;
  }

  /* Responsive social icons for small screens */
  .social-icons {
    gap: 6px;
  }

  .social-icons a {
    width: 32px;
    height: 32px;
  }

  .social-icons a i {
    font-size: 16px;
  }

  .skills-container {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .projects-container {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .achievements-container {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .heading {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 1), 0 0 20px rgba(255, 255, 255, 0.4), 0 0 15px rgba(255, 140, 0, 0.6);
    letter-spacing: 0.5px;
  }
  
  .heading span {
    font-weight: 800;
    text-shadow: 3px 3px 12px rgba(0, 0, 0, 1), 0 0 25px var(--glow-color), 0 0 35px var(--glow-color), 0 0 45px rgba(255, 140, 0, 0.8);
    filter: brightness(1.3) contrast(1.15);
  }

  /* Optimize form inputs */
  .contact form .input-box input {
    width: 100%;
    margin-bottom: 0.8rem;
  }
}

/* Responsive Design Adjustments */

/* Phone-only Social Icons Centering */
/* .home-sci REMOVED - Using .social-icons */

/* Contact Form Select Styles */
.subject-select {
  width: 100%;
  padding: 15px;
  border-radius: 8px;
  border: 2px solid #0ef;
  background: transparent;
  color: var(--text-color);
  font-size: 16px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230ef'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
}

.subject-select option {
  background: var(--bg-color);
  color: var(--text-color);
  padding: 10px;
}

/* Ultra-compact spacing for mobile phones */
@media (max-width: 480px) {
  .home {
    min-height: 70vh !important;
    padding: calc(var(--header-height-mobile) + 0rem + var(--hero-extra-space-mobile)) 4% 0.8rem !important;
    gap: 0.8rem !important;
  }

  section {
    padding: 1rem 4% 0.5rem !important;
  }
}

/* Maximum compression for very small screens */
@media (max-width: 360px) {
  .home {
    min-height: 60vh !important;
    padding: calc(var(--header-height-mobile) + 0rem + var(--hero-extra-space-mobile)) 3% 0.5rem !important;
    gap: 0.5rem !important;
  }

  section {
    padding: 0.8rem 3% 0.3rem !important;
  }
}

/* ============================================
   ELFSIGHT CHATBOT VISIBILITY FIX
   ============================================ */
/* Ensure Elfsight chatbot is always visible and above all elements */
div[class*="elfsight-app"],
div[data-elfsight-app-lazy],
.elfsight-app-6614ceb4-fee4-43c5-8fb5-7e8d6cc3b8aa {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  z-index: 999999 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
}

/* Ensure the chatbot iframe and container are visible */
div[class*="elfsight-app"] iframe,
.elfsight-app-6614ceb4-fee4-43c5-8fb5-7e8d6cc3b8aa iframe {
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
}

/* Mobile adjustments for chatbot */
@media (max-width: 768px) {
  div[class*="elfsight-app"],
  .elfsight-app-6614ceb4-fee4-43c5-8fb5-7e8d6cc3b8aa {
    bottom: 80px !important; /* Above footer on mobile */
    right: 15px !important;
  }
}
