/* ===== CSS VARIABLES ===== */
:root {
  /* Color palette - LIGHT theme defaults (changed from dark) */
  --bg: #ffffff;
  --surface: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --accent: #0ea5e9;
  --on-accent: #ffffff;
  --danger: #dc2626;
  
  /* Text color hierarchy - LIGHT theme defaults */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  /* Icon and UI colors */
  --icon-bg: rgba(0, 0, 0, 0.05);
  --icon-border: rgba(0, 0, 0, 0.1);
  
  /* WhatsApp colors */
  --whatsapp-green: #25D366;
  --whatsapp-dark: #128C7E;
  
  /* Spacing and layout */
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  
  /* Border radius */
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  
  /* Shadows */
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.4s ease;
}

/* ===== DARK THEME ===== */
html[data-theme="dark"] {
  --bg: #0b0f14;
  --surface: #121821;
  --text: #e6edf3;
  --muted: #9fb0c3;
  --border: #223042;
  --accent: #1ecbe1;
  --on-accent: #041016;
  --danger: #ff6b6b;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --icon-bg: rgba(255, 255, 255, 0.1);
  --icon-border: rgba(255, 255, 255, 0.2);
  
  /* Dark theme shadows */
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* Dark theme specific background */
html[data-theme="dark"] body {
  background: radial-gradient(1200px 800px at 10% -20%, rgba(30, 203, 225, 0.12), transparent 60%), 
              radial-gradient(1000px 700px at 90% -10%, rgba(30, 203, 225, 0.08), transparent 60%), 
              var(--bg);
}

/* Ensure all text elements inherit the theme colors */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] p,
html[data-theme="dark"] span,
html[data-theme="dark"] li,
html[data-theme="dark"] a {
  color: var(--text);
}

/* Ensure smooth transitions for all theme changes */
html[data-theme="dark"] *,
html[data-theme="light"] * {
  transition: background-color var(--transition-normal), 
              color var(--transition-normal), 
              border-color var(--transition-normal),
              box-shadow var(--transition-normal);
}

/* Dark theme button styling */
html[data-theme="dark"] .btn {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] .btn:hover {
  background-color: var(--border);
}

/* Dark theme card styling */
html[data-theme="dark"] .card {
  background-color: var(--surface);
  border-color: var(--border);
}

/* Dark theme skill items */
html[data-theme="dark"] .skill {
  background-color: var(--surface);
  border-color: var(--border);
}

/* Dark theme canvas background */
html[data-theme="dark"] #bg-particles {
  background-color: var(--bg);
}

/* ===== BASE STYLES ===== */
html {
  scroll-behavior: smooth;
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Theme toggle button styling */
#themeToggle {
  background: none;
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: var(--surface);
  margin-left: auto;
  position: relative;
  z-index: 10;
  /* Override any conflicting styles */
  min-height: 40px !important;
  min-width: 40px !important;
  /* Modern glassmorphism effect */
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

#themeToggle:hover {
  transform: scale(1.1) rotate(10deg);
  border-color: var(--accent);
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.15) 0%, 
    rgba(255, 255, 255, 0.1) 100%);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 20px rgba(14, 165, 233, 0.3);
}

#themeToggle:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

#themeToggle:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  transform: scale(1.05);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 20px rgba(14, 165, 233, 0.3);
}

/* Dark theme specific button styling */
html[data-theme="dark"] #themeToggle {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] #themeToggle:hover {
  box-shadow: 0 0 15px rgba(30, 203, 225, 0.3);
}

/* Smooth theme transitions - exclude specific elements for better performance */
* {
  transition: background-color var(--transition-normal), 
              color var(--transition-normal), 
              border-color var(--transition-normal),
              box-shadow var(--transition-normal);
}

/* Exclude certain elements from transitions for better performance */
img, svg, canvas, video {
  transition: none;
}

body {
  font-family: Inter, system-ui, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 10% -20%, rgba(14, 165, 233, 0.08), transparent 60%), 
              radial-gradient(1000px 700px at 90% -10%, rgba(14, 165, 233, 0.06), transparent 60%), 
              var(--bg);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  height: auto;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== TYPOGRAPHY ===== */
.display, .lead, .section-title, h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  margin: 0;
}

p, span, div, li, a {
  color: var(--text-primary);
}

.muted, .text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

/* ===== HEADER & NAVIGATION ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  transition: all var(--transition-normal);
}

.site-header.glass {
  backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in oklab, var(--surface) 60%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.brand:hover {
  opacity: 0.8;
}

.logo {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #64e1f4);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 0.875rem;
}

.wordmark {
  font-weight: 600;
  color: var(--text-primary);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Dark mode brand text enhancement */
html[data-theme="dark"] .wordmark {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ===== DESKTOP NAVIGATION ===== */
.desktop-nav {
  display: none;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.nav-list a {
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.6rem;
  transition: background-color var(--transition-fast);
  font-weight: 500;
}

.nav-list a.active,
.nav-list a:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Ensure navigation links are always readable */
.nav-list a {
  position: relative;
  z-index: 1;
}

.nav-list a.active {
  background: var(--icon-bg);
  border-color: var(--accent);
}

/* ===== MOBILE NAVIGATION ===== */
.mobile-nav-toggle {
  display: flex;
  align-items: center;
}

/* Show hamburger only on mobile (<=768px), hide desktop nav there */
.hamburger { display: none; }
@media (max-width: 768px) {
  .desktop-nav { display: none; }
  #menuToggle { display: inline-flex; }
}
@media (min-width: 769px) {
  .desktop-nav { display: flex; }
  #menuToggle { display: none; }
}

.hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1001;
  /* Modern glassmorphism effect */
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Modern hover effects */
.hamburger:hover {
  transform: scale(1.05) rotate(5deg);
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.15) 0%, 
    rgba(255, 255, 255, 0.1) 100%);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 20px rgba(14, 165, 233, 0.2);
}

.hamburger:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

/* Animated hamburger icon */
/* Remove pseudo icon to prevent double symbol; rely on .hamburger-line bars */

.hamburger:hover {
  background: var(--icon-bg);
  border-color: var(--icon-border);
}

.hamburger span {
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
  transition: all var(--transition-fast);
}

.hamburger span::before,
.hamburger span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  transform-origin: center;
  transition: all var(--transition-fast);
}

.hamburger span::before {
  top: -6px;
}

.hamburger span::after {
  top: 6px;
}

/* ===== BUTTONS ===== */
.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.5rem 0.7rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1rem;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--icon-bg);
  border-color: var(--icon-border);
  transform: translateY(-1px);
}

.icon-btn.close {
  align-self: flex-end;
}

/* Theme toggle specific styling */
#themeToggle {
  font-size: 1.2rem;
  z-index: 50;
  /* Ensure theme toggle is always visible */
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

/* Theme toggle hover and focus states */
#themeToggle:hover {
  background: var(--icon-bg);
  border-color: var(--icon-border);
  transform: translateY(-1px);
}

#themeToggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(30, 203, 225, 0.1);
}

/* ===== MOBILE MENU ===== */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: saturate(180%) blur(20px) brightness(1);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  visibility: hidden;
  /* Modern glassmorphism effect */
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.2) 0%, 
    rgba(255, 255, 255, 0.1) 100%);
}

.mobile-menu[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  /* Enhanced backdrop effect when open */
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.6) 0%, 
    rgba(255, 255, 255, 0.4) 100%);
}

.mobile-inner {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(86vw, 360px);
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  transform: translateX(100%) scale(0.95);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  /* Modern glassmorphism panel */
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.3) 0%, 
    rgba(255, 255, 255, 0.15) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.mobile-menu[aria-hidden="false"] .mobile-inner {
  transform: translateX(0) scale(1);
  /* Enhanced glow effect when open */
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 40px rgba(14, 165, 233, 0.1);
}

.mobile-nav {
  flex: 1;
}

.mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.mobile-nav-link {
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  font-weight: 500;
  text-align: center;
  /* Mobile-optimized: simple text, no complex effects */
  font-size: 1.1rem;
  line-height: 1.4;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  /* Modern glassmorphism button effect */
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  /* Subtle gradient overlay */
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    rgba(255, 255, 255, 0.05) 100%);
}

/* Modern hover and active effects */
.mobile-nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.2), 
    transparent);
  transition: left 0.5s ease;
}

.mobile-nav-link:hover::before {
  left: 100%;
}

.mobile-nav-link:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.15) 0%, 
    rgba(255, 255, 255, 0.1) 100%);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.2);
}

.mobile-nav-link:active {
  transform: translateY(0);
  transition: transform 0.1s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background: rgba(255, 255, 255, 0.06);
}

/* Ensure mobile navigation links maintain readability */
.mobile-nav-link.active {
  background: var(--icon-bg);
  border: 1px solid var(--accent);
  color: var(--text-primary);
}

/* Focus styles for accessibility */
.mobile-nav-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 20px rgba(14, 165, 233, 0.3);
}

.hamburger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  transform: scale(1.05);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 20px rgba(14, 165, 233, 0.3);
}

/* Modern animation classes */
.menu-opening .mobile-inner {
  animation: slideInFromRight 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInFromRight {
  0% {
    transform: translateX(100%) scale(0.95);
    opacity: 0;
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

/* Staggered animation for menu items */
.mobile-nav-link {
  animation: fadeInUp 0.3s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

.mobile-nav-link:nth-child(1) { animation-delay: 0.1s; }
.mobile-nav-link:nth-child(2) { animation-delay: 0.2s; }
.mobile-nav-link:nth-child(3) { animation-delay: 0.3s; }
.mobile-nav-link:nth-child(4) { animation-delay: 0.4s; }
.mobile-nav-link:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modern loading states */
.mobile-menu[aria-hidden="false"] .mobile-nav-link {
  animation: fadeInUp 0.3s ease forwards;
}

/* Enhanced active state */
.mobile-nav-link.active {
  background: linear-gradient(135deg, 
    rgba(14, 165, 233, 0.2) 0%, 
    rgba(14, 165, 233, 0.1) 100%);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: var(--accent);
  box-shadow: 
    0 8px 25px rgba(14, 165, 233, 0.2),
    0 0 0 1px rgba(14, 165, 233, 0.3);
}

.mobile-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-6);
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
  .mobile-nav-link {
    /* Ensure touch-friendly sizing */
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Simple hover effect for mobile */
    background: transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .mobile-nav-link:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  .mobile-nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
  }
  
  /* Improve mobile theme toggle visibility */
  #themeToggle {
    min-height: 44px;
    min-width: 44px;
    font-size: 1.2rem;
  }
  
  /* Ensure mobile menu is properly positioned */
  .mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
  
  /* Enhanced mobile menu panel */
  .mobile-inner {
    width: 100vw;
    right: 0;
    left: 0;
    border-radius: 0;
    border: none;
    /* Modern mobile glassmorphism */
    background: linear-gradient(135deg, 
      rgba(255, 255, 255, 0.15) 0%, 
      rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(25px) saturate(200%);
    box-shadow: 
      0 25px 50px -12px rgba(0, 0, 0, 0.4),
      0 0 0 1px rgba(255, 255, 255, 0.2);
  }
  
  /* Modern mobile menu backdrop for light theme */
  .mobile-menu {
    background: linear-gradient(135deg, 
      rgba(255, 255, 255, 0.7) 0%, 
      rgba(255, 255, 255, 0.5) 100%);
    backdrop-filter: blur(25px) brightness(1);
  }
}

/* Dark theme: mobile menu and panel visuals */
html[data-theme="dark"] .mobile-menu {
  background: linear-gradient(135deg,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.4) 100%);
  backdrop-filter: saturate(180%) blur(20px) brightness(0.8);
}

html[data-theme="dark"] .mobile-menu[aria-hidden="false"] {
  background: linear-gradient(135deg,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.5) 100%);
}

html[data-theme="dark"] .mobile-inner {
  background: linear-gradient(135deg,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.3) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* ===== HERO SECTION ===== */
.hero {
  position: relative;
}

/* Ensure hero text has proper contrast in both themes */
.hero .display {
  color: var(--text-primary);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.hero .lead {
  color: var(--text-primary);
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.hero .muted {
  color: var(--text-muted);
  font-weight: 400;
}

.hero .subtitle {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Dark mode specific hero text enhancements */
html[data-theme="dark"] .hero .display,
html[data-theme="dark"] .hero .lead {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.hero .actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* ===== CARDS ===== */
.card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background: linear-gradient(180deg, 
              color-mix(in oklab, var(--surface) 92%, transparent), 
              color-mix(in oklab, var(--surface) 98%, transparent));
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-fast), 
              box-shadow var(--transition-fast), 
              border-color var(--transition-fast);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.card h3 {
  margin: 0.2rem 0;
  color: var(--text-primary);
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card p {
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Dark mode card text enhancement */
html[data-theme="dark"] .card h3 {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ===== SKILLS ===== */
.skill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border: 1px dashed var(--border);
  border-radius: 999px;
  background: color-mix(in oklab, var(--surface) 80%, transparent);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.skill:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: color-mix(in oklab, var(--surface) 90%, transparent);
}

.skill img {
  width: 24px;
  height: 24px;
  /* Ensure icons display in their original colors */
  filter: none;
  /* Remove any potential color overrides */
  color: unset;
  fill: unset;
  stroke: unset;
}

.skill span {
  color: var(--text-primary);
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Dark mode skill text enhancement */
html[data-theme="dark"] .skill span {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ===== CTA SECTION ===== */
.cta-band {
  background: linear-gradient(135deg, 
              color-mix(in oklab, var(--accent) 22%, var(--bg)), 
              transparent);
  margin-bottom: 0;
  padding-bottom: 0;
  padding-top: var(--space-6);
}

.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.cta-inner h3 {
  color: var(--text-primary);
  margin: 0;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Dark mode CTA text enhancement */
html[data-theme="dark"] .cta-inner h3 {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), 
              box-shadow var(--transition-fast);
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.project-card img {
  aspect-ratio: 16/9;
  object-fit: cover;
}

.project-card .content {
  padding: 1rem;
  display: grid;
  gap: 0.6rem;
}

.project-card h3 {
  color: var(--text-primary);
  margin: 0;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.project-card p {
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Dark mode project card text enhancement */
html[data-theme="dark"] .project-card h3 {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ===== TIMELINE ===== */
.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.timeline-list li {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;
  align-items: start;
}

.time {
  color: var(--text-muted);
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Dark mode timeline text enhancement */
html[data-theme="dark"] .time {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 0;
  margin-bottom: 0;
  padding-top: var(--space-4);
  padding-bottom: 0;
  position: relative;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: var(--space-4);
}

.social {
  list-style: none;
  display: flex;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}

.social a {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.4rem;
  background: var(--surface);
  transition: all var(--transition-fast);
  min-height: 48px;
  min-width: 48px;
  align-items: center;
  justify-content: center;
}

.social a:hover {
  background: var(--icon-bg);
  border-color: var(--icon-border);
  transform: translateY(-2px);
}

.social img {
  /* Force original icon rendering regardless of theme */
  filter: none !important;
  color: initial !important;
  fill: initial !important;
  stroke: initial !important;
  mix-blend-mode: normal !important;
  -webkit-mask: none !important;
  mask: none !important;
  image-rendering: auto;
}

/* Make footer icons light in dark mode for visibility */
html[data-theme="dark"] .site-footer .social img {
  filter: invert(1) brightness(1.2) !important;
}

/* In case inline SVGs are ever used inside the footer social list */
.site-footer .social svg {
  filter: none !important;
  color: initial !important;
  fill: initial !important;
  stroke: initial !important;
  mix-blend-mode: normal !important;
}

.copyright {
  color: var(--text-secondary);
  margin: 0;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Dark mode footer text enhancement */
html[data-theme="dark"] .copyright {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ===== WHATSAPP FLOATING BUTTON ===== */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: var(--whatsapp-green);
  color: white;
  border-radius: 50%;
  text-align: center;
  font-size: 30px;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all var(--transition-normal);
  border: none;
  cursor: pointer;
  filter: drop-shadow(0 4px 12px rgba(37, 211, 102, 0.3));
}

.whatsapp-float:hover {
  background: var(--whatsapp-dark);
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4);
  filter: drop-shadow(0 6px 20px rgba(37, 211, 102, 0.4));
}

.whatsapp-float:active {
  transform: scale(0.95);
}

.whatsapp-float svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

/* ===== PARTICLE CANVAS ===== */
#bg-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
}

/* ===== MAIN ELEMENT ===== */
main {
  margin: 0;
  padding: 0;
}

main:last-child {
  margin-bottom: 0;
}

/* ===== FOCUS & ACCESSIBILITY ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:focus-visible,
.whatsapp-float:focus-visible,
.social a:focus-visible,
.nav-list a:focus-visible,
.mobile-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(30, 203, 225, 0.1);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (min-width: 800px) {
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
  }


  
  .mobile-nav-toggle {
    display: none;
  }
}

/* Mobile performance optimizations */
@media (max-width: 768px) {
  /* Reduce animations on mobile for better performance */
  .card,
  .skill,
  .project-card {
    transition: none;
  }
  
  .card:hover,
  .skill:hover,
  .project-card:hover {
    transform: none;
    box-shadow: var(--shadow-soft);
  }
  
  /* Simplify particle effects on mobile */
  #bg-particles {
    opacity: 0.3;
  }
  
  /* Reduce backdrop-filter usage on mobile for better performance */
  .site-header.glass {
    backdrop-filter: none;
    background: color-mix(in oklab, var(--surface) 95%, transparent);
  }
}

@media (max-width: 768px) {
  .header-inner {
    padding-block: 8px;
  }
  
  .brand .wordmark {
    font-size: 0.9rem;
  }
  
  .logo {
    width: 32px;
    height: 32px;
  }
  
  /* Ensure mobile navigation is properly displayed */
  .mobile-nav-toggle {
    display: flex !important;
  }
  
  .desktop-nav {
    display: none !important;
  }
  
  .hero .actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .hero .actions .btn {
    text-align: center;
  }
  
  .card {
    padding: 0.875rem;
  }
  
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
  }
  
  .skill {
    padding: 0.5rem 0.75rem;
    flex-direction: column;
    text-align: center;
    gap: 0.4rem;
  }
  
  .skill span {
    font-size: 0.875rem;
  }
  
  .cta-inner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .timeline-list li {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .time {
    font-size: 0.875rem;
  }
  
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .social {
    justify-content: center;
  }
  
  .whatsapp-float {
    width: 56px;
    height: 56px;
    bottom: 16px;
    right: 16px;
  }
  
  .whatsapp-float svg {
    width: 28px;
  }
  
  .mobile-inner {
    width: 100vw;
    right: 0;
    left: 0;
  }
}

@media (max-width: 480px) {
  .hero .display {
    font-size: clamp(1.5rem, 10vw, 2rem);
    line-height: 1.2;
  }
  
  .hero .lead {
    font-size: clamp(0.9rem, 4.5vw, 1.1rem);
    line-height: 1.5;
  }
  
  .hero .muted {
    font-size: 0.95rem;
    line-height: 1.6;
  }
  
  .card h3 {
    font-size: 1.1rem;
  }
  
  .card p {
    font-size: 0.9rem;
  }
  
  .section-title {
    font-size: 1.1rem;
  }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  .nav-list a,
  .mobile-nav a,
  .btn,
  .skill {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .social a {
    min-height: 48px;
    min-width: 48px;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .btn:hover,
  .whatsapp-float:hover,
  .social a:hover,
  .skill:hover,
  .card:hover,
  .project-card:hover {
    transform: none;
  }
  
  .reveal {
    transition: none;
  }
  
  .mobile-inner {
    transition: none;
  }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
  .btn,
  .card,
  .skill {
    border-width: 2px;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .whatsapp-float,
  .back-to-top,
  .mobile-menu,
  .hamburger {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card,
  .skill {
    border: 1px solid #ccc;
    background: white;
  }
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}
