/* ==========================================================================
   PORTFOLIO DESIGN SYSTEM & GLOBAL STYLES (razuahmed75.github.io)
   ========================================================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@800&family=JetBrains+Mono&display=swap');

:root {
  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Bricolage Grotesque', sans-serif;

  /* Typography Scale */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 20px;
  --text-xl: 24px;
  --text-2xl: 32px;
  --text-3xl: 48px;
  --text-4xl: 64px;

  /* Spacing Grid (8px base) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
  --space-12: 96px;
  --space-16: 128px;

  /* Border Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Light Theme Colors (Default) */
  --bg-color: #fafafa;
  --surface-color: #ffffff;
  --surface-color-2: #f4f4f8;
  --border-color: #e4e4e7;
  --text-primary: #09090b;
  --text-muted: #71717a;
  
  --accent-color: #0d1b2a;
  --accent-2-color: #00b4d8;
  --accent-glow: rgba(13, 27, 42, 0.08);
  --accent-2-glow: rgba(0, 180, 216, 0.15);
  --success-color: #10b981;
  --error-color: #ef4444;

  --btn-primary-bg: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-2-color) 100%);
  --btn-primary-shadow: 0 4px 14px rgba(13, 27, 42, 0.2);

  --shadow-card: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 40px var(--accent-2-glow);
  --glass-bg: rgba(250, 250, 250, 0.5);
}

/* Dark Theme Overrides */
body.dark {
  --bg-color: #0a0a0f;
  --surface-color: #111118;
  --surface-color-2: #1a1a24;
  --border-color: rgba(255, 255, 255, 0.06);
  --text-primary: #f1f0ff;
  --text-muted: #8b8ba7;
  
  --accent-color: #0d1b2a;
  --accent-2-color: #00b4d8;
  --accent-glow: rgba(13, 27, 42, 0.15);
  /* --accent-2-glow: rgba(0, 180, 216, 0.25); */
  --success-color: #10b981;
  --error-color: #ef4444;

  --btn-primary-bg: linear-gradient(135deg, var(--accent-2-color) 0%, #0077b6 100%);
  --btn-primary-shadow: 0 4px 14px rgba(0, 180, 216, 0.3);

  --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 45px var(--accent-2-glow);
  --glass-bg: rgba(10, 10, 15, 0.75);
}

/* Global resets & scroll behavior */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-color);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

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

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

/* Scrollbar styling */
body::-webkit-scrollbar {
  width: 10px;
}
body::-webkit-scrollbar-track {
  background: var(--bg-color);
}
body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-color);
}
body::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Utility Layout Classes */
.container-custom {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.section-padding {
  padding: var(--space-12) 0;
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent-2-color) 0%, var(--accent-glow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */
.header-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  background: var(--glass-bg);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(12px);
  transition: background var(--transition-normal), border var(--transition-normal);
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.nav-logo img {
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-2-color);
}

/* Theme-based header & footer logo switching */
.nav-logo .dark-logo,
.footer-logo .dark-logo {
  display: none !important;
}

body.dark .nav-logo .light-logo,
body.dark .footer-logo .light-logo {
  display: none !important;
}

body.dark .nav-logo .dark-logo,
body.dark .footer-logo .dark-logo {
  display: inline !important;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
}

.nav-link {
  position: relative;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  padding: var(--space-1) 0;
  transition: color var(--transition-fast);
}

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

/* Active Nav Underline Animation */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-2-color), var(--accent-2-color));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-normal);
  border-radius: var(--radius-full);
}

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

/* Nav CTA Button */
.nav-cta-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--accent-2-color);
  color: #ffffff;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 6px 6px 6px 22px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
  transition: opacity 0.2s, transform 0.2s;
}

.nav-cta-btn:hover {
  opacity: 0.92;
  color: #ffffff;
}

.nav-cta-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #000000;
  overflow: hidden;
  flex-shrink: 0;
}

.nav-cta-icon .icon-arrow {
  position: absolute;
  width: 16px;
  height: 16px;
  color: #DCFC36;
  display: block;
}

.nav-cta-icon .icon-hover {
  opacity: 0;
  transform: translate(-12px, 12px);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: background var(--transition-fast), border var(--transition-fast), transform var(--transition-normal);
}

.theme-toggle-btn:hover {
  background: var(--surface-color-2);
  border-color: var(--text-muted);
  transform: scale(1.05);
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: transform var(--transition-slow);
}

body.dark .theme-toggle-btn svg {
  transform: rotate(360deg);
}

/* Mobile Menu Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition: transform var(--transition-normal), opacity var(--transition-normal);
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100vh;
  background: var(--surface-color);
  border-left: 1px solid var(--border-color);
  z-index: 1050;
  padding: 100px var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  box-shadow: var(--shadow-card);
  transition: right var(--transition-slow);
}

.mobile-drawer.open {
  right: 0;
}

.mobile-drawer .nav-menu-mobile {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.mobile-drawer .nav-link {
  font-size: var(--text-lg);
  display: block;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.mobile-drawer .nav-link:hover {
  background: var(--surface-color-2);
}

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Responsive Navbar */
@media (max-width: 1024px) {
  .nav-menu {
    gap: var(--space-2);
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  .hamburger {
    display: flex;
  }
  
  .hamburger.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .hamburger.open span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 100px;
  background-image: 
    radial-gradient(circle at 10% 20%, var(--accent-glow) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, var(--accent-2-glow) 0%, transparent 40%);
}

#hero-rain-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: auto;
  cursor: pointer;
}

/* Dot Grid Background Overlay */
.hero-bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr 0.85fr;
  gap: var(--space-5);
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-align: left;
}

.hero-middle {
  display: flex;
  justify-content: center;
  align-self: flex-start;
  z-index: 2;
  margin-top: 10px; /* Small adjustment to line up with the greeting text */
}

.hero-greeting {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--accent-2-color);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: clamp(20px, 3.5vw, 22px);
  font-weight: 700;
  color: var(--text-primary);
  min-height: 48px;
}

.hero-description {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.6;
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  flex-wrap: wrap;
}

/* Premium Buttons */
.btn-primary {
  background: var(--btn-primary-bg);
  color: #ffffff;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-sm);
  border: none;
  box-shadow: var(--btn-primary-shadow);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--btn-primary-shadow);
  opacity: 0.95;
  color: #ffffff;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  padding: 13px 27px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-sm);
  border: 2px solid var(--border-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

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

/* Social Row */
.social-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.social-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
}

.social-btn:hover {
  color: var(--accent-2-color);
  border-color: var(--accent-2-color);
  background: var(--surface-color-2);
  transform: translateY(-3px);
}

/* Codewars badge card */
.codewars-card {
  margin-top: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
  box-shadow: var(--shadow-card);
}

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

.codewars-card img {
  max-height: 40px;
  object-fit: contain;
}

/* Hero Right: 3D Visual Element */
.hero-right {
  display: flex;
  justify-content: center;
  position: relative;
}

.hero-avatar-wrapper {
  position: relative;
  width: 320px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* inner focused beam */
.hero-avatar-wrapper::after {
    content: '';
    position: absolute;
    top: -260px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 190px solid transparent;
    border-right: 190px solid transparent;
    border-top: 450px solid rgba(200, 220, 255, 0.1);
    filter: blur(10px);
    z-index: 0;
    pointer-events: none;
}

.avatar-glow {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 60px;
  background: radial-gradient(ellipse, var(--accent-2-glow) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.hero-avatar {
  width: 260px;
  height: 260px;
  box-shadow: var(--shadow-card);
  z-index: 2;
  object-fit: cover;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  border: 5px solid rgba(0, 180, 216, 0.25);
  animation: morph 8s ease-in-out infinite;
  transition: all 0.5s ease-in-out;
}

.hero-avatar:hover {
  transform: scale(1.05) rotate(2deg);
  border-color: var(--accent-2-color);
  box-shadow: 0 0 25px var(--accent-2-glow);
}

/* Tech Floating Icon tags on Hero */
.floating-tag {
  position: absolute;
  padding: 8px 16px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-card);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 3;
  animation: float-tag 4s ease-in-out infinite;
  transition: all 0.3s ease;
}

.floating-tag:hover {
  border-color: var(--accent-2-color);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 15px var(--accent-2-glow);
  transform: scale(1.05);
}

.floating-tag-1 {
  top: 15%;
  right: -5%;
  animation-delay: 0s;
}

.floating-tag-2 {
  bottom: 15%;
  left: -10%;
  animation-delay: 1.5s;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--text-muted);
  cursor: pointer;
  z-index: 2;
}

.scroll-indicator svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  animation: scroll-bounce 2s infinite;
}

/* Keyframes */
@keyframes pulse-glow {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.1); opacity: 1; }
}

@keyframes morph {
  0%,100% { border-radius: 30% 70% 70% 30%/30% 30% 70% 70%; }
  25%      { border-radius: 50% 50% 50% 50%/50% 50% 50% 50%; }
  50%      { border-radius: 70% 30% 30% 70%/70% 70% 30% 30%; }
  75%      { border-radius: 50% 50% 50% 50%/50% 50% 50% 50%; }
}

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

@keyframes float-tag {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes scroll-bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(6px); }
  60% { transform: translateY(3px); }
}

@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-4);
  }
  .hero-left {
    align-items: center;
    text-align: center;
  }
  .hero-description {
    margin: 0 auto;
  }
  .hero-ctas {
    justify-content: center;
  }
  .social-row {
    justify-content: center;
  }
  .codewars-card {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-avatar-wrapper {
    width: 240px;
    height: 240px;
  }

  .hero-avatar {
    width: 180px;
    height: 180px;
  }
}

/* ==========================================================================
   ABOUT SECTION
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-6);
  align-items: start;
}

.about-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.about-bio {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-muted);
}

.about-bio strong {
  color: var(--text-primary);
}

.about-right {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}

/* Stat Cards */
.stat-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  text-align: center;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-2-color);
  box-shadow: var(--shadow-glow);
}

.stat-number {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--accent-2-color);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* ==========================================================================
   SKILLS SECTION
   ========================================================================== */
.skills-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.skills-group {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-card);
}

.skills-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.skills-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface-color-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  cursor: default;
}

.skill-badge i {
  font-size: 1rem;
}

.skill-badge:hover {
  background: var(--surface-color);
  border-color: var(--accent-2-color);
  box-shadow: 0 0 12px var(--accent-glow);
  transform: translateY(-2px);
  color: var(--accent-2-color);
}

/* ==========================================================================
   PROJECTS SECTION
   ========================================================================== */
.projects-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.featured-project {
  margin-bottom: var(--space-4);
}

.project-hero-card {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  position: relative;
  background: none;
  background-image: linear-gradient(var(--surface-color), var(--surface-color)), linear-gradient(135deg, var(--accent-2-color), transparent 40%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.project-hero-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.project-hero-card::before {
  content: "Featured";
  position: absolute;
  top: 18px;
  left: -48px;
  width: 170px;
  padding: 5px 0;
  background: linear-gradient(90deg, var(--accent-2-color), color-mix(in srgb, var(--accent-2-color) 80%, white));
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: center;
  transform: rotate(-45deg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  z-index: 2;
  pointer-events: none;
}

.project-hero-content {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-2);
}

.featured-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  background: var(--accent-glow);
  color: var(--accent-2-color);
  border-radius: var(--radius-full);
}

.project-hero-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-hero-title {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-primary);
}

.project-hero-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

.project-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-badge {
  font-size: var(--text-xs);
  padding: 4px 10px;
  background-color: color-mix(in srgb, var(--accent-2-color) 10%, transparent);
  color: var(--accent-2-color);
  border: 1px solid color-mix(in srgb, var(--accent-2-color) 20%, transparent);
  border-radius: var(--radius-full);
  font-weight: 500;
}

.project-hero-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-2);
}

.project-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.project-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-color-2);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.project-link-btn:hover {
  background: var(--accent-2-color);
  color: #ffffff;
  border-color: var(--accent-2-color);
}

.project-hero-img-wrapper {
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 250px;
  background: var(--surface-color-2);
}

.project-hero-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

/* Grid of Other Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.project-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-2-color);
  box-shadow: var(--shadow-glow);
}

/* Colored accent bar at top of project card */
.project-card-header {
  height: 6px;
  background: linear-gradient(90deg, var(--accent-2-color), var(--accent-2-color));
}

.project-card-body {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex-grow: 1;
}

.project-card-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.project-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: #ffffff;
}

.project-card-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
}

.project-card-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
  flex-grow: 1;
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.project-card-footer {
  border-top: 1px solid var(--border-color);
  padding: var(--space-2) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface-color-2);
}

.project-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
}

.project-store-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text-primary);
}

.project-store-link img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
}

.project-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  padding: 4px 10px;
  color: var(--accent-2-color);
  border-radius: var(--radius-sm);
  background-color: color-mix(in srgb, var(--accent-2-color) 10%, transparent);
  color: var(--accent-2-color);
  border: 1px solid color-mix(in srgb, var(--accent-2-color) 20%, transparent);
}

.project-cta-link:hover {
  text-decoration: underline;
}

.projects-cta-container {
  text-align: center;
  margin-top: var(--space-6);
}

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

@media (max-width: 768px) {
  .project-hero-card {
    grid-template-columns: 1fr;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   TIMELINE (EXPERIENCE & EDUCATION)
   ========================================================================== */
.section-title {
  text-align: center;
  font-size: var(--text-2xl);
  margin-bottom: var(--space-6);
  position: relative;
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-2-color), var(--border-color) 80%);
  transform: scaleY(var(--timeline-scale, 0));
  transform-origin: top center;
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-4);
}

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

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--surface-color);
  border: 3px solid var(--accent-2-color);
  box-shadow: 0 0 10px var(--accent-glow);
  z-index: 2;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.3);
  background: var(--accent-2-color);
}

.timeline-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.timeline-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-2-color);
  box-shadow: var(--shadow-glow);
}

.timeline-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-2);
}

.timeline-role {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-company {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent-2-color);
  margin-left: 6px;
}

.timeline-company a {
  color: var(--accent-2-color);
}

.timeline-date {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-color-2);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.timeline-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

.timeline-desc ul {
  list-style: none;
  margin-top: 10px;
}

.timeline-desc ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
}

.timeline-desc ul li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--accent-2-color);
  font-weight: bold;
}

/* ==========================================================================
   CONTACT SECTION
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-6);
  align-items: start;
}

.contact-form-container {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
  position: relative;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Floating Label Fields */
.form-group {
  position: relative;
  display: flex;
  flex-direction: column;
}

.form-control {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  padding: 18px 16px 6px;
  background: var(--surface-color-2);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.form-control:focus {
  border-color: var(--accent-2-color);
  background: var(--surface-color);
}

.form-control.is-invalid {
  border-color: var(--error-color);
  animation: shake 0.4s ease;
}

.form-control.is-invalid:focus {
  border-color: var(--error-color);
}

.form-label {
  position: absolute;
  left: 16px;
  top: 14px;
  font-size: var(--text-sm);
  color: var(--text-muted);
  pointer-events: none;
  transition: transform var(--transition-fast), font-size var(--transition-fast), color var(--transition-fast);
}

/* Label transition on focus/input */
.form-control:focus ~ .form-label,
.form-control:not(:placeholder-shown) ~ .form-label {
  transform: translateY(-8px);
  font-size: var(--text-xs);
  color: var(--accent-2-color);
}

.form-control.is-invalid ~ .form-label {
  color: var(--error-color);
}

.form-control::placeholder {
  color: transparent;
}

.error-message {
  display: none;
  font-size: 11px;
  color: var(--error-color);
  margin-top: 3px;
  padding-left: 4px;
  animation: fadeSlideDown 0.25s ease both;
}

.form-control.is-invalid ~ .error-message {
  display: block;
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

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

.btn-submit {
  position: relative;
  overflow: hidden;
  width: 100%;
  background: transparent;
  color: var(--accent-2-color);
  border: 1px solid var(--accent-2-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-submit .blob {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: var(--accent-2-color);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.btn-submit .btn-text {
  position: relative;
  z-index: 1;
}

.contact-info-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.contact-card-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}

.contact-card-row:hover {
  transform: translateX(4px);
  border-color: var(--accent-2-color);
  box-shadow: var(--shadow-glow);
}

.contact-card-icon {
  width: 44px;
  height: 44px;
  background: var(--surface-color-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-2-color);
  font-size: 1.1rem;
}

.contact-card-details {
  display: flex;
  flex-direction: column;
}

.contact-card-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.contact-card-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  border-top: 1px solid var(--border-color);
  background: var(--surface-color);
  padding: var(--space-4) 0;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text-primary);
}

.footer-logo img {
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.footer-socials .social-btn {
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
}

.footer-copy {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.footer-copy span {
  color: var(--error-color);
}

/* ==========================================================================
   ANIMATIONS & TRANSITIONS (INTERSECTION OBSERVER REVEALS)
   ========================================================================== */
body:not(.gsap-enabled) .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

body:not(.gsap-enabled) .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger classes */
body:not(.gsap-enabled) .reveal-stagger > * {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

body:not(.gsap-enabled) .reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Apply delays using JS or CSS transitions */
.reveal-stagger.visible > *:nth-child(1) { transition-delay: 50ms; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 100ms; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 150ms; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 200ms; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 250ms; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 300ms; }
.reveal-stagger.visible > *:nth-child(7) { transition-delay: 350ms; }
.reveal-stagger.visible > *:nth-child(8) { transition-delay: 400ms; }
.reveal-stagger.visible > *:nth-child(9) { transition-delay: 450ms; }
.reveal-stagger.visible > *:nth-child(10) { transition-delay: 500ms; }
.reveal-stagger.visible > *:nth-child(11) { transition-delay: 550ms; }
.reveal-stagger.visible > *:nth-child(12) { transition-delay: 600ms; }

/* ==========================================================================
   LENIS SMOOTH SCROLLING
   ========================================================================== */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS FIXES
   ========================================================================== */

/* Display Utility Classes for Codewars Badge */
.d-none {
  display: none !important;
}
.d-inline {
  display: inline-block !important;
}

@media (max-width: 768px) {
  .d-md-none {
    display: inline-block !important;
  }
  .d-md-inline {
    display: none !important;
  }
  
  /* Reduce side padding on mobile screens to gain space */
  .container-custom {
    padding: 0 var(--space-2); /* 16px padding instead of 24px */
  }
  
  /* Compact section padding for mobile */
  .section-padding {
    padding: var(--space-6) 0; /* 48px padding instead of 96px */
  }
  
  /* Hide lighting effect on mobile */
  .hero-avatar-wrapper::after {
        display: none;
    }

    .avatar-glow {
        display: none;
    }
}

@media (min-width: 769px) {
  .d-md-none {
    display: none !important;
  }
  .d-md-inline {
    display: inline-block !important;
  }
}

/* Stacking and resizing stat cards on mobile */
@media (max-width: 576px) {
  .about-right {
    gap: var(--space-1);
  }
  .stat-card {
    padding: var(--space-2);
    min-height: 110px;
  }
  .stat-number {
    font-size: var(--text-2xl);
  }
}

@media (max-width: 480px) {
  .about-right {
    grid-template-columns: 1fr;
  }
  /* Hide hero floating tags to prevent overflow/clutter on narrow devices */
  .floating-tag {
    display: none !important;
  }
}

/* Prevent timeline headers from wrapping awkwardly or overflowing */
@media (max-width: 576px) {
  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .timeline-company {
    margin-left: 0;
    display: block;
    margin-top: 4px;
  }
}

/* Featured Project layout and actions alignment */
@media (max-width: 768px) {
  .project-hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
    text-align: center;
  }
  .project-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-2);
  }
}

@media (max-width: 576px) {
  .project-links {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .project-links .project-store-link {
    margin-left: 0 !important; /* override inline styles */
    justify-content: center;
    background: var(--surface-color-2);
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
  }
  .project-link-btn {
    justify-content: center;
    width: 100%;
  }
  .contact-form-container {
    padding: var(--space-2);
  }
  .contact-card-row {
    padding: var(--space-2);
    gap: var(--space-2);
  }
}

/* Word break for contact items like long emails/links to prevent card blowout */
.contact-card-value {
  word-break: break-all;
  overflow-wrap: break-word;
}

/* Responsive Mobile Drawer Enhancements */
@media (max-width: 480px) {
  .mobile-drawer {
    width: 85vw;
    right: -85vw;
    padding: 80px var(--space-2) var(--space-3);
  }
  .mobile-drawer.open {
    right: 0;
  }
}

/* GSAP Animations & Page Transitions CSS */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-2-color);
  z-index: 9999;
  transform-origin: left;
  transform: scaleX(0);
  will-change: transform;
}

#page-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--surface-color);
  z-index: 10000;
  transform-origin: top center;
  will-change: transform;
}

.header-nav.scrolled {
  background: rgba(10, 10, 15, 0.85);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);

}
body:not(.dark) .header-nav.scrolled {
  background: rgba(255, 255, 255, 0.85);
}

/* Performance Optimizations via will-change */
.header-nav,
.nav-link,
#hero h1,
.hero-greeting,
.hero-subtitle,
.cta-buttons a,
.social-links a,
.hero-avatar-wrapper,
.scroll-down,
.about-text,
.stat-number,
h2.section-title,
.heading-line,
#skills h3,
.skill-badge,
.project-hero-card,
.project-card,
.timeline::before,
.timeline-item,
.timeline-dot,
.contact-info-container,
.contact-form-container input,
.contact-form-container textarea {
  will-change: transform, opacity;
}

.gsap-hidden {
  opacity: 0;
}

/* Unique Dynamic Vector Signature styles */
.signature-container {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Cormorant Garamond', serif;
  color: inherit;
  background: transparent;
}

.name-row {
  position: relative;
  font-size: clamp(32px, 5vw, 55px);
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.z-anchor, .d-anchor {
  display: inline-block;
}

.tail-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.tail-path {
  stroke: var(--accent-2-color);
  stroke-width: 5px;
  stroke-linecap: round;
}


.divider {
  width: 100%;
  height: 0.5px;
  background-color: currentColor;
  opacity: 0.3;
  margin: 14px 0;
}

.subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  padding-left: 0.4em;
  opacity: 0.8;
}


/* Line 216 Animation (Subtitle Emojis) */
.fade-pulse {
  display: inline-block;
  animation: fade-pulse 3s ease-in-out infinite;
}

@keyframes fade-pulse {
  0%,100% { transform: translateY(0) rotate(0deg); opacity: 1; }
  25%      { transform: translateY(-10px) rotate(15deg); opacity: 0.8; }
  50%      { transform: translateY(-4px) rotate(-10deg); opacity: 0.5; }
  75%      { transform: translateY(-8px) rotate(5deg); opacity: 0.9; }
}

/* Tail Dot Animation */
.tail-dot {
  animation: tail-dot-pulse 2s infinite ease-in-out;
  transform-origin: center;
  transform-box: fill-box;
}

@keyframes tail-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.2; transform: scale(1.3); }
}

.arrow-ping {
  display: inline-block;
  animation: ping 2.5s cubic-bezier(0.4,0,0.6,1) infinite;
}

@keyframes ping {
  0%,100% { transform: translateX(0); opacity: 1; }
  40%     { transform: translateX(8px); opacity: 0; }
  41%     { transform: translateX(-4px); opacity: 0; }
  60%     { transform: translateX(0); opacity: 1; }
}

.download-ping {
  display: inline-block;
  animation: downloadPing 2.5s cubic-bezier(0.4,0,0.6,1) infinite;
}

@keyframes downloadPing {
  0%,100% { transform: translateY(0); opacity: 1; }
  40%     { transform: translateY(8px); opacity: 0; }
  41%     { transform: translateY(-4px); opacity: 0; }
  60%     { transform: translateY(0); opacity: 1; }
}
