/* Modern Portfolio Styles - Inspired by Cursor and Bolt.new */
:root {
  /* Minimalist Portfolio Styles - Black, White, Grey, Red */
  --primary: #dc2626;
  /* Red 600 */
  --primary-dark: #b91c1c;
  /* Red 700 */
  --primary-light: #ef4444;
  /* Red 500 */
  --secondary: #991b1b;
  /* Red 800 */
  --accent: #dc2626;
  /* Red 600 */

  --dark: #0a0a0a;
  /* Near Black */
  --light: #ffffff;
  /* Pure White */

  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;

  --background: var(--light);
  --text: var(--dark);

  --card-bg: #ffffff;
  --card-border: var(--gray-200);
  --nav-bg: rgba(255, 255, 255, 0.95);
  --nav-text: var(--dark);
  --footer-text: var(--gray-600);

  /* Shared variables */
  --border-radius: 4px;
  /* Minimalist sharp corners */
  --transition: all 0.2s ease;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --focus-ring: 0 0 0 2px rgba(220, 38, 38, 0.5);
}

/* Dark mode theme - improved for accessibility */
/* Dark mode theme - improved for accessibility */
body.dark-theme {
  --primary: #ef4444;
  /* Red 500 - More saturated */
  --primary-dark: #dc2626;
  /* Red 600 */
  --primary-light: #f87171;
  /* Red 400 */
  --secondary: #991b1b;
  /* Red 800 */
  --accent: #ef4444;

  --dark: #0a0a0a;
  --light: #171717;

  --gray-100: #262626;
  --gray-200: #404040;
  --gray-300: #525252;
  --gray-400: #737373;
  --gray-500: #a3a3a3;
  --gray-600: #d4d4d4;
  --gray-700: #e5e5e5;
  --gray-800: #f5f5f5;
  --gray-900: #ffffff;

  --background: #121212;
  /* Soft Black (Material-like) */
  --text: #e5e5e5;
  /* Light Grey for text */

  --card-bg: #1e1e1e;
  /* Lighter than background for separation */
  --card-border: #333333;
  /* Subtle border */
  --nav-bg: rgba(18, 18, 18, 0.95);
  --nav-text: #e5e5e5;
  --footer-text: #9ca3af;
  --footer-bg: #121212;

  /* Shadows in dark mode */
  --shadow-sm: none;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --focus-ring: 0 0 0 2px rgba(239, 68, 68, 0.5);
}

/* Global Styles */
body {
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
  padding: 0;
  background-color: var(--background);
  padding-top: 80px;
  border: none;
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
  z-index: 1;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .highlight-card:hover,
  .project-card:hover,
  .highlight-card:hover .highlight-img img,
  .project-card:hover .project-img img,
  .media-text:hover,
  .media-text img:hover,
  .highlight-link:hover,
  .project-link:hover,
  .nav-links a:hover:after,
  .mobile-nav-links a:hover {
    transform: none !important;
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Typography - Updated with new fonts */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

/* Improved for screen reader compatibility */
h1 span.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--gray-700);
  /* Darker for better contrast */
  font-size: 1.125rem;
}

/* Improved link styles for accessibility */
a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

a:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  text-decoration: underline;
}

a:focus:not(:focus-visible) {
  box-shadow: none;
}

a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Spacers */
.spacer {
  height: 120px;
}

.spacer-small {
  height: 60px;
}

/* Personal intro section */
.personal-intro {
  margin-top: 0;
  margin-bottom: 20px;
  padding: 0 0 20px;
  position: relative;
}

.personal-intro h1 {
  font-size: 3.5rem;
  max-width: 900px;
  position: relative;
}

.personal-intro h1::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 0;
  width: 100px;
  height: 4px;
  /* Thinner line */
  background: var(--primary);
  /* Solid Red */
  border-radius: 0;
  /* Square edges */
}

.personal-intro .subtitle {
  font-size: 1.5rem;
  color: var(--gray-600);
  max-width: 800px;
  margin-top: 2rem;
  font-weight: 500;
}

.media-text {
  display: flex;
  align-items: center;
  margin-bottom: 80px;
  gap: 60px;
  padding: 40px;
  border-radius: var(--border-radius);
  background-color: var(--card-bg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.media-text::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.media-text:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 15px rgba(220, 38, 38, 0.15);
}

.media-text-reverse {
  flex-direction: row-reverse;
}

.media-text-reverse::before {
  left: unset;
  right: 0;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.media-text-content {
  flex: 40%;
}

.media-text-media {
  flex: 60%;
}

.media-text img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.media-text img:hover {
  transform: scale(1.02);
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.4));
}

/* Project links */
.project-link,
.media-text-content a {
  display: inline-block;
  margin-top: 0;
  /* Changed from 1rem to align properly */
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  /* Keep pill shape or make it square? rounded is better for buttons */
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  font-family: 'Source Sans 3', sans-serif;
}

.project-link:hover,
.media-text-content a:hover {
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: white !important;
  /* Ensure text stays white despite global a:hover rule */
}

.project-link:focus,
.media-text-content a:focus {
  outline: none;
  box-shadow: var(--shadow-sm), var(--focus-ring);
}

/* Ensure project-links is at the bottom of the card */
.project-links {
  margin-top: auto;
  display: block;
  width: 100%;
}

/* Stealth Link Styles for clickable cards */
.stealth-link {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
  display: block;
}

.stealth-link:hover {
  text-decoration: none;
  color: inherit;
}

/* Ensure images inside links behave correctly */
.project-img .stealth-link {
  display: block;
  width: 100%;
  height: 100%;
}

/* Make titles change color on hover when they are links */
.project-title .stealth-link {
  color: inherit;
}

.project-title:hover .stealth-link {
  color: var(--primary);
}

/* Video Embed */
.video-container {
  position: relative;
  width: 100%;
  margin-bottom: 40px;
  border-radius: var(--border-radius);
  background-color: var(--card-bg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  overflow: hidden;
}

.video-container::before {
  content: '';
  display: block;
  padding-top: 56.25%;
  /* 16:9 aspect ratio */
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Navigation Bar */
.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  /* Extremely high z-index */
  background-color: var(--nav-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  transition: var(--transition);
}

.main-nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.05em;
}

.nav-links {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  align-items: center;
  gap: 1.5rem;
}

.nav-links li {
  margin-left: 0;
}

.nav-links a {
  font-weight: 600;
  font-size: 1rem;
  color: var(--nav-text);
  position: relative;
  text-decoration: none;
  padding: 0.5rem 0;
  display: inline-block;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background: var(--primary);
  transition: width 0.3s;
}

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

/* Hamburger Menu */
.hamburger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  cursor: pointer;
}

.hamburger-menu span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 1px;
  background: var(--primary);
  transition: var(--transition);
}

/* Mobile Sidebar */
.mobile-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 300px;
  height: 100vh;
  background-color: var(--card-bg);
  box-shadow: var(--shadow-xl);
  z-index: 1001;
  padding: 2rem;
  transition: right 0.3s ease;
  border-left: 1px solid var(--card-border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  transform: translateX(100%);
}

.mobile-sidebar.active {
  right: 0;
  visibility: visible;
  transform: translateX(0);
}

.mobile-sidebar-close {
  align-self: flex-end;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--nav-text);
  transition: var(--transition);
}

.mobile-sidebar-close:hover {
  color: var(--primary);
}

.mobile-nav-links {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}

.mobile-nav-links li {
  margin-bottom: 1.5rem;
}

.mobile-nav-links a {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  transition: var(--transition);
  padding: 0.5rem 0;
}

.mobile-nav-links a:hover {
  color: var(--primary);
  transform: translateX(5px);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* Footer */
footer {
  background: var(--dark);
  color: white;
  padding: 80px 0 40px;
  margin-top: 60px;
  position: relative;
  overflow: hidden;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary);
  z-index: 2;
  /* Ensure it sits on top of any background artifacts */
}

footer .container {
  position: relative;
  z-index: 1;
  text-align: center;
}

footer h2 {
  font-size: 2rem;
  color: white;
  margin-bottom: 2rem;
}

footer p {
  color: var(--footer-text);
  margin-top: 2rem;
  font-size: 0.9rem;
}

.custom-social-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0;
  gap: 2rem;
}

.custom-social-container a svg {
  transition: var(--transition);
  fill: white;
}

/* Media Queries */
@media (max-width: 992px) {
  .media-text {
    padding: 30px;
    gap: 40px;
  }

  .spacer {
    height: 100px;
  }

  .spacer-small {
    height: 50px;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2rem;
  }

  .personal-intro {
    padding: 40px 0;
    margin-top: 40px;
    margin-bottom: 60px;
  }

  .personal-intro .subtitle {
    font-size: 1.3rem;
  }

  .theme-toggle {
    margin-left: 0.5rem;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  p {
    font-size: 1rem;
  }

  .spacer {
    height: 80px;
  }

  .spacer-small {
    height: 40px;
  }

  .personal-intro {
    padding: 30px 0;
    margin-top: 30px;
    margin-bottom: 50px;
  }

  .personal-intro .subtitle {
    font-size: 1.25rem;
    margin-top: 1.5rem;
  }

  .main-nav .container {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .hamburger-menu {
    display: flex;
  }

  .logo {
    display: flex;
    align-items: center;
  }

  .nav-links {
    display: none;
  }

  .main-nav {
    padding: 12px 0;
  }

  body {
    padding-top: 60px;
  }

  .mobile-sidebar {
    padding: 1.5rem;
  }

  .mobile-sidebar.active {
    right: 0;
  }

  .mobile-sidebar-close {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  footer {
    padding: 60px 0 30px;
  }

  footer .container {
    padding: 0 20px;
  }

  footer h2 {
    font-size: 1.75rem;
  }

  .media-text,
  .media-text-reverse {
    flex-direction: column;
    padding: 24px;
    gap: 30px;
  }

  .media-text-reverse::before,
  .media-text::before {
    width: 100%;
    height: 6px;
    top: 0;
    left: 0;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
  }

  .media-text .media-text-media,
  .media-text-reverse .media-text-media {
    flex: 100%;
    order: 1;
  }

  .media-text .media-text-content,
  .media-text-reverse .media-text-content {
    flex: 100%;
    order: 2;
  }

  .project-link,
  .media-text-content a {
    display: block;
    text-align: center;
  }

  .media-text-media img {
    width: 100%;
  }

  section,
  .section {
    padding: 0;
  }

  .video-container {
    margin-bottom: 30px;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    margin-left: 0;
  }

  .highlight-tags {
    margin: 12px 15px 6px;
  }

  .highlight-card h3 {
    margin: 10px 15px 8px;
    font-size: 1.3rem;
  }

  .highlight-card {
    flex: 0 0 320px;
    min-width: 320px;
  }

  .highlight-img {
    height: 220px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .personal-intro .subtitle {
    font-size: 1.1rem;
    margin-top: 1.25rem;
  }

  .media-text,
  .media-text-reverse {
    padding: 20px;
    margin-bottom: 40px;
  }

  .spacer {
    height: 60px;
  }

  .spacer-small {
    height: 30px;
  }

  .personal-intro {
    padding: 20px 0;
    margin-top: 20px;
    margin-bottom: 40px;
  }

  .mobile-sidebar {
    width: 85%;
    right: -85%;
  }

  .hamburger-menu {
    width: 24px;
    height: 16px;
  }

  .custom-social-container {
    gap: 1.5rem;
  }

  .theme-toggle {
    width: 32px;
    height: 32px;
  }

  .highlight-tags {
    margin: 10px 12px 5px;
    gap: 6px;
  }

  .highlight-card h3 {
    font-size: 1.15rem;
    margin: 8px 12px 6px;
  }

  .highlight-card p {
    margin: 0 12px 16px;
    font-size: 0.9rem;
  }

  .highlight-link {
    margin: 0 12px 12px;
    font-size: 0.85rem;
  }

  .highlight-card {
    flex: 0 0 300px;
    min-width: 300px;
  }

  .highlight-img {
    height: 200px;
  }
}

/* Project Categories and Filtering */
.project-filters {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 15px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.filter-btn {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  z-index: 1;
  position: relative;
  overflow: visible;
  min-width: 120px;
  display: inline-block;
  text-align: center;
}

.filter-btn:hover,
.filter-btn:focus,
.filter-btn.active {
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  color: white !important;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Project Filter List for smaller screens */
@media (max-width: 768px) {
  .project-filters {
    gap: 10px;
  }

  .filter-btn {
    font-size: 14px;
    padding: 8px 15px;
    min-width: 100px;
  }
}

/* Removing conflicting styles */
.project-filter {
  display: none;
}

/* Maintaining high z-index on hover */
.filter-btn:hover,
.filter-btn:focus,
.filter-btn.active {
  z-index: 10;
}

/* Project Grid Layout */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
  position: relative;
  z-index: 1;
  /* Ensure the entire grid is in a proper stacking context */
}

.project-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1),
    box-shadow 0.5s cubic-bezier(0.19, 1, 0.22, 1),
    opacity 0.6s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--card-border);
  opacity: 0;
  transform: translateY(20px);
  z-index: 1;
  will-change: transform, box-shadow;
}

.project-card.hidden {
  opacity: 0;
  transform: translateY(20px);
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 15px rgba(220, 38, 38, 0.15);
  z-index: 5;
}



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

.project-card-body {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  font-family: 'Outfit', sans-serif;
}

.project-card p {
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  color: var(--text);
  /* Improved contrast */
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  /* Increase spacing between tags and title */
}

.project-tag {
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  /* Improved touch target */
  border-radius: 20px;
  /* Rounded for modern feel */
  background-color: var(--gray-100);
  color: var(--gray-800);
  /* Improved contrast */
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 500;
}

.project-card-footer {
  margin-top: auto;
}

.project-card-link {
  display: inline-block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary);
  transition: var(--transition);
  padding: 0.5rem 0;
  /* Larger touch target */
}

.project-card-link:hover {
  color: var(--primary-dark);
  transform: translateX(5px);
  text-decoration: underline;
}

.project-card-link:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  text-decoration: underline;
}

.project-card-link i {
  margin-left: 0.5rem;
  transition: inherit;
}

.project-card-link:hover i {
  transform: translateX(3px);
}

/* Highlight cards - larger than project cards */
.highlight-card {
  width: 100%;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  border: 1px solid var(--card-border);
  z-index: 1;
  padding-bottom: 15px;
  display: flex;
  flex-direction: column;
  height: 580px;
  /* Adding fixed height for all cards */
}

.highlight-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 15px rgba(220, 38, 38, 0.15);
  z-index: 2;
}

.highlight-card:focus-within {
  box-shadow: var(--shadow-lg), var(--focus-ring);
  transform: translateY(-2px);
}



.highlight-card h3 {
  font-size: 1.5rem;
  margin: 15px 22px 12px;
  color: var(--text);
  font-family: 'Outfit', sans-serif;
}

.highlight-card p {
  margin: 0 22px 22px;
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.5;
  flex-grow: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  /* Limit to 3 lines */
  line-clamp: 3;
  -webkit-box-orient: vertical;
}

.highlight-link {
  display: inline-block;
  margin: 10px 22px 22px;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  padding: 0.5rem 0;
  font-family: 'Source Sans 3', sans-serif;
  position: relative;
}

.highlight-img {
  position: relative;
  height: 220px;
  /* Reducing the image height to make cards more uniform */
  overflow: hidden;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.highlight-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.highlight-card:hover .highlight-img img {
  transform: scale(1.03);
}

.project-img {
  position: relative;
  height: 200px;
  overflow: hidden;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.project-card:hover .project-img img {
  transform: scale(1.03);
}

.project-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-video-img {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  background-color: var(--dark);
  /* Placeholder background */
}

.project-video-img iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Fix for dark mode h1 text */
body.dark-theme h1 {
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: #f9fafb;
  background-clip: initial;
  color: #f9fafb;
}

.highlight-reel-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
  padding: 1.5rem 0;
  margin: 2.5rem 0;
  width: 100%;
}

/* Media Queries */
@media (max-width: 992px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  .highlight-card {
    width: 100%;
  }

  .highlight-img {
    height: 240px;
  }
}

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

  .highlight-card {
    width: 100%;
  }

  .highlight-img {
    height: 230px;
  }

  .highlight-card h3 {
    font-size: 1.4rem;
    margin: 18px 20px 10px;
  }

  .highlight-card p {
    margin: 0 20px 18px;
    font-size: 1rem;
  }

  .highlight-link {
    margin: 0 20px 18px;
  }

  .project-img {
    height: 200px;
  }

  .filter-btn {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
  }
}

@media (max-width: 480px) {
  .highlight-card {
    width: 100%;
  }

  .highlight-img {
    height: 200px;
  }

  .highlight-card h3 {
    font-size: 1.25rem;
    margin: 12px 15px 8px;
  }

  .highlight-card p {
    margin: 0 15px 15px;
    font-size: 0.95rem;
  }

  .highlight-link {
    margin: 0 15px 15px;
    font-size: 0.9rem;
  }

  .project-img {
    height: 180px;
  }
}

/* Dark mode toggle - improved for accessibility */
.theme-toggle {
  background: transparent;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background-color: var(--gray-100);
}

.theme-toggle:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* In light mode (default), show the moon icon */
.theme-toggle i.fa-moon {
  display: inline-block;
}

.theme-toggle i.fa-sun {
  display: none;
}

/* In dark mode, show the sun icon */
body.dark-theme .theme-toggle i.fa-moon {
  display: none;
}

body.dark-theme .theme-toggle i.fa-sun {
  display: inline-block;
}

/* Dark mode specific text color overrides to ensure WCAG compliance */
body.dark-theme p {
  color: #d1d5db;
  /* Lighter paragraph text for better contrast */
}

body.dark-theme .project-card:hover,
body.dark-theme .project-card:focus-within,
body.dark-theme .highlight-card:hover,
body.dark-theme .highlight-card:focus-within,
body.dark-theme .media-text:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(220, 38, 38, 0.3);
}

body.dark-theme .project-card p,
body.dark-theme .highlight-card p {
  color: #e5e7eb;
  /* Brighter text for cards in dark mode */
}

body.dark-theme .personal-intro .subtitle {
  color: #d1d5db;
  /* Lighter subtitle text */
}

body.dark-theme .project-tag {
  color: #f3f4f6;
  /* Brighter tag text */
  background-color: #374151;
  /* Darker tag background for contrast */
}

body.dark-theme .stat-label {
  color: #d1d5db;
  /* Brighter stat label */
}

body.dark-theme .footer p {
  color: #d1d5db;
  /* Brighter footer text */
}

/* Removed duplicate highlight-reel-container styles */

.highlight-img {
  position: relative;
  height: 240px;
  overflow: hidden;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.highlight-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.project-card:hover .project-img img {
  transform: scale(1.03);
}

.project-content {
  padding: 1.5rem;
}

/* Fix for dark mode h1 text */
body.dark-theme h1 {
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: #f9fafb;
  background-clip: initial;
  color: #f9fafb;
}

.highlight-link:hover {
  color: var(--primary-dark);
  transform: translateX(5px);
  text-decoration: underline;
}

.highlight-link:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  text-decoration: underline;
}

/* Project Details Modal */
.project-details {
  padding: 2rem;
  border-radius: var(--border-radius);
  background-color: var(--card-bg);
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
  border: 1px solid var(--card-border);
  position: relative;
}

.project-details::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: var(--primary);
  border-radius: var(--border-radius) 0 0 var(--border-radius);
}

/* Featured Project */
.featured-project {
  background: linear-gradient(135deg, var(--background), var(--card-bg));
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 4rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.featured-project::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: var(--primary);
}

.featured-project-badge {
  position: absolute;
  top: 1rem;
  right: 0;
  background: var(--primary);
  color: white;
  padding: 0.25rem 1rem 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 4px 0 0 4px;
  letter-spacing: 0.5px;
}

.featured-project-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.featured-project-img {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  height: 100%;
  object-fit: cover;
}

.featured-project-text h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.featured-project-text p {
  margin-bottom: 1.5rem;
}

.featured-project-link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border-radius: 30px;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.featured-project-link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: white;
}

/* Project Fade Animation */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Project Section Styles */
.projects-section {
  padding: 50px 0;
}

.project-filters {
  display: flex;
  justify-content: center;
}

/* Video Modal Styles */
.video-modal {
  display: none;
  position: fixed;
  z-index: 100000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-modal.active {
  display: flex;
  opacity: 1;
}

.video-modal-content {
  position: relative;
  background-color: transparent;
  margin: auto;
  padding: 0;
  width: 95%;
  max-width: 1200px;
  animation: modalZoom 0.3s ease;
}

.video-modal-content .video-container {
  border: none;
  background-color: transparent;
  box-shadow: none;
  margin-bottom: 0;
}

@keyframes modalZoom {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.close-video-modal {
  color: #fff;
  float: right;
  font-size: 40px;
  font-weight: bold;
  position: absolute;
  top: -40px;
  right: 0;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
  z-index: 100001;
}

.close-video-modal:hover,
.close-video-modal:focus {
  color: var(--primary);
  text-decoration: none;
  cursor: pointer;
}

/* Button style for video trigger */
button.project-link {
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
}

button.project-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}



.filter-btn {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  z-index: 1;
  position: relative;
  overflow: visible;
  min-width: 120px;
  display: inline-block;
  text-align: center;
}

.filter-btn:hover,
.filter-btn:focus,
.filter-btn.active {
  background: var(--primary);
  color: white !important;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Project Filter List for smaller screens */
@media (max-width: 768px) {
  .project-filters {
    gap: 10px;
  }

  .filter-btn {
    font-size: 14px;
    padding: 8px 15px;
    min-width: 100px;
  }
}

/* Removing conflicting styles */
.project-filter {
  display: none;
}

/* Maintaining high z-index on hover */
.filter-btn:hover,
.filter-btn:focus,
.filter-btn.active {
  z-index: 10;
}

/* Featured Image Section */
.featured-image-section {
  margin: 60px 0;
  padding: 0;
  position: relative;
}

.featured-image-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.featured-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 3/4;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.featured-image-wrapper:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.featured-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.featured-image-wrapper:hover .featured-portrait {
  transform: scale(1.05);
}

.featured-image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  padding: 30px;
  color: white;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.featured-image-wrapper:hover .featured-image-overlay {
  opacity: 1;
  transform: translateY(0);
}

.featured-quote {
  font-style: italic;
  text-align: center;
}

.featured-quote p {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: white;
  line-height: 1.4;
}

.quote-author {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.featured-image-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.featured-image-text h2 {
  position: relative;
  padding-bottom: 15px;
  margin-bottom: 5px;
}

.featured-image-text h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 0;
}

.featured-image-text p {
  font-size: 1.125rem;
  max-width: 540px;
  margin-bottom: 30px;
}

.featured-stats {
  display: flex;
  gap: 40px;
  margin-top: 20px;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  color: var(--primary);
  /* Removed gradient */
  line-height: 1;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--gray-600);
  font-weight: 500;
}

/* Media queries for the featured image section */
@media (max-width: 992px) {
  .featured-image-container {
    gap: 30px;
  }

  .featured-quote p {
    font-size: 1.1rem;
  }

  .stat-number {
    font-size: 2.2rem;
  }
}

@media (max-width: 768px) {
  .featured-image-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .featured-image-wrapper {
    aspect-ratio: 16/9;
    width: 100%;
  }

  .featured-image-overlay {
    opacity: 1;
    transform: translateY(0);
  }

  .featured-image-text {
    text-align: center;
  }

  .featured-image-text h2::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .featured-stats {
    justify-content: center;
  }

  .featured-image-text p {
    max-width: 100%;
  }
}

/* Dark mode for featured image section */
body.dark-theme .featured-image-wrapper {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

body.dark-theme .featured-image-overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.4), transparent);
}

body.dark-theme .featured-image-text p {
  color: #d1d5db;
  /* Updated for better contrast */
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .project-card:hover,
  .service-card:hover,
  .highlight-card:hover,
  .filter-btn:hover,
  .project-card-link:hover,
  .project-link:hover,
  .media-text-content a:hover,
  .highlight-link:hover,
  .submit-btn:hover,
  .contact-item:hover .contact-icon {
    transform: none !important;
  }
}

.highlight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 15px 22px 15px;
}

/* Project cards - improving spacing between tags and title */
.project-title {
  margin-top: 0.75rem;
}

/* Make project links consistently aligned to bottom left */
.project-links {
  margin-top: auto;
}

/* Make project description take available space */
.project-description {
  flex-grow: 1;
  margin-bottom: 1.25rem;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  box-shadow: var(--shadow-lg);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  background: var(--primary-dark);
}

.back-to-top:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.5), var(--shadow-lg);
}

/* Ensure accessible focus ring works in dark mode */
body.dark-theme .back-to-top:focus {
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.6), var(--shadow-lg);
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }
}