/* Font Face Declarations - Critical for cross-browser consistency */
@font-face {
  font-family: 'Noto Sans Condensed';
  src: url('../fonts/NotoSans_Condensed-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans Condensed';
  src: url('../fonts/NotoSans_Condensed-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans Condensed';
  src: url('../fonts/NotoSans_Condensed-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* CSS Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Noto Sans Condensed', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Layout */
.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Navigation - Enhanced cross-browser support */
.nav {
  position: sticky;
  position: -webkit-sticky; /* Safari support */
  top: 0;
  z-index: 50;
  /* Light mode: Stronger shadow and border for visibility */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  /* Backdrop filter with fallback */
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.98); /* Slightly more opaque */
}

/* Fallback for browsers without backdrop-filter support */
@supports not ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))) {
  .nav {
    background: rgba(255, 255, 255, 1);
  }
}

.dark .nav { 
  background: rgba(31, 41, 55, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@supports not ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))) {
  .dark .nav {
    background: rgba(31, 41, 55, 1);
  }
}

.nav-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  background: linear-gradient(135deg, #667eea 0%, #14b8a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  /* Fallback for unsupported browsers */
  color: #667eea;
}

/* Better support for gradient text */
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .nav-logo {
    color: transparent;
  }
}

.nav-links a {
  margin-left: 1.5rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
  color: #374151; /* Dark gray text in light mode for better contrast */
}

.dark .nav-links a {
  color: #d1d5db; /* Light gray in dark mode */
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: linear-gradient(135deg, #667eea 0%, #14b8a6 100%);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:hover {
  color: #667eea;
}

.dark .nav-links a:hover {
  color: #14b8a6;
}

/* Desktop Navigation - Hidden on Mobile */
.desktop-nav {
  display: none;
}

@media (min-width: 768px) {
  .desktop-nav {
    display: block;
  }
}

/* Mobile Navigation */
.mobile-nav {
  background: white;
  border-top: 1px solid #e5e7eb;
  padding: 1rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); /* Add shadow for depth */
}

.dark .mobile-nav {
  background: #1f2937;
  border-top-color: #374151;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 1rem;
  font-weight: 500;
  transition: background-color 0.2s;
  color: #374151; /* Dark text in light mode */
}

.dark .mobile-nav-link {
  color: #d1d5db; /* Light text in dark mode */
}

.mobile-nav-link:hover {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(20, 184, 166, 0.1) 100%);
  color: #667eea;
}

.dark .mobile-nav-link:hover {
  background: #374151;
  color: #14b8a6;
}

.mobile-menu-btn {
  cursor: pointer;
}

.btn {
  border: 1px solid #d1d5db;
  padding: .4rem .75rem;
  border-radius: .375rem;
  cursor: pointer;
  transition: all 0.3s;
  background: white;
  color: #374151; /* Dark text in light mode */
  font-weight: 500;
}

.btn:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(20, 184, 166, 0.1) 100%);
  border-color: #667eea;
  color: #667eea;
}

.dark .btn {
  background: #1f2937;
  color: #d1d5db;
  border-color: #4b5563;
}

.dark .btn:hover {
  background: #374151;
  border-color: #14b8a6;
  color: #14b8a6;
}

/* Hero */
.hero {
  text-align: center;
  padding: 6rem 1rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(20, 184, 166, 0.05) 100%);
  position: relative;
}

.dark .hero { 
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(20, 184, 166, 0.08) 100%);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(20, 184, 166, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

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

.hero-avatar {
  width: 10rem;
  height: 10rem;
  border-radius: 9999px;
  object-fit: cover;
  margin: 0 auto 1.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,.15);
  border: 4px solid white;
  transition: transform 0.3s ease;
}

.dark .hero-avatar {
  border-color: #1f2937;
}

.hero-avatar:hover {
  transform: scale(1.05);
}

/* Hero - Responsive font sizing */
.hero-title {
  font-size: clamp(2rem, 5vw, 2.75rem); /* Responsive: 32px to 44px */
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #14b8a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #667eea; /* Fallback */
  line-height: 1.2;
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .hero-title {
    color: transparent;
  }
}

.hero-subtitle {
  font-size: clamp(1rem, 3vw, 1.25rem); /* Responsive: 16px to 20px */
  color: #374151;
  margin-bottom: 1rem;
  font-weight: 500;
}
.dark .hero-subtitle { color: #d1d5db; }

.hero-text {
  max-width: 48rem;
  margin: 0 auto 2rem;
  font-size: clamp(1rem, 2vw, 1.125rem); /* Responsive: 16px to 18px */
  line-height: 1.8;
}

.hero-socials {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.hero-socials a {
  transition: transform 0.3s ease;
  display: inline-block;
}

.hero-socials a:hover {
  transform: translateY(-4px);
}

.hero-socials img {
  width: 2rem;
  height: 2rem;
  filter: grayscale(50%);
  transition: filter 0.3s ease;
}

.hero-socials a:hover img {
  filter: grayscale(0%);
}

/* Sections */
.section {
  padding: 4rem 0;
}
@media (min-width: 768px) {
  .section { padding: 6rem 0; }
}

/* Section Title - Responsive */
.section-title {
  font-size: clamp(1.5rem, 4vw, 1.875rem); /* Responsive: 24px to 30px */
  font-weight: 700;
  margin-bottom: 2rem;
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 4px;
  background: linear-gradient(135deg, #667eea 0%, #14b8a6 100%);
  border-radius: 2px;
}

/* Cards */
.card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0,0,0,.06);
  transition: all 0.3s ease;
  border: 1px solid transparent;
}
.dark .card { 
  background: #1f2937;
  box-shadow: 0 4px 15px rgba(0,0,0,.2);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.3);
}

.dark .card:hover {
  box-shadow: 0 12px 30px rgba(20, 184, 166, 0.2);
  border-color: rgba(20, 184, 166, 0.3);
}

/* Card Title - Responsive */
.card-title {
  font-size: clamp(1rem, 2.5vw, 1.25rem); /* Responsive: 16px to 20px */
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #14b8a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #667eea; /* Fallback */
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .card-title {
    color: transparent;
  }
}

.card-meta {
  font-size: .875rem;
  color: #6b7280;
  margin-bottom: .5rem;
}

.card-text {
  color: #374151;
  margin-bottom: 1rem;
  line-height: 1.7;
}
.dark .card-text { color: #d1d5db; }

.link {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
}

.link:hover {
  color: #14b8a6;
}

.dark .link {
  color: #14b8a6;
}

.dark .link:hover {
  color: #5eead4;
}

/* Skills */
.skill-title {
  font-weight: 600;
  margin-bottom: .5rem;
  color: #667eea;
  font-size: 1.1rem;
}

.dark .skill-title {
  color: #14b8a6;
}

.skill-list {
  list-style: none;
  padding-left: 0;
}

.skill-list li {
  color: #4b5563;
  padding: 0.4rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.skill-list li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: #667eea;
  font-weight: bold;
}

.dark .skill-list li {
  color: #d1d5db;
}

.dark .skill-list li::before {
  color: #14b8a6;
}

/* Footer */
.footer {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  color: #e5e7eb;
  text-align: center;
  padding: 1.5rem;
}

/* Gradient Buttons */
.gradient-btn {
  background: linear-gradient(135deg, #667eea 0%, #14b8a6 100%);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.gradient-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Mobile-specific fixes */
@media (max-width: 767px) {
  .hero {
    padding: 4rem 1rem; /* Reduced padding on mobile */
  }
  
  .hero-avatar {
    width: 8rem;
    height: 8rem;
  }
  
  .section {
    padding: 3rem 0;
  }
  
  .card {
    padding: 1.5rem;
  }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero {
    padding: 5rem 1rem;
  }
}

/* Print */
@media print {
  nav, footer, #themeToggle { display: none; }
  body { background: white; color: black; }
}
