:root {
  /* Primary Colors */
  --color-primary: #006ca2; /* Blue */
  --color-secondary: #64a60a; /* Green */

  /* Background Colors */
  --color-background: #fbfcfe; /* Main light background with very subtle blue hint */
  --color-background-alt: #f0f8f0; /* Light white/green background instead of blue tint */
  --color-background-dark: #1a1a1a; /* Dark background for hero and contact section */

  /* Text Colors */
  --color-text: #333;
  --color-text-white: white;

  /* UI Element Colors */
  --color-card-bg: white;
  --color-shadow: rgba(0, 0, 0, 0.1);
  --color-shadow-hover: rgba(0, 0, 0, 0.15);
  --color-shadow-light: rgba(0, 0, 0, 0.05);
  --color-placeholder: #e0e0e0;
  --color-placeholder-icon: #888888;
  --color-overlay: rgba(51, 51, 51, 0.7);
  --color-border: #ccc;
}

/* Mobile-specific override for services - high specificity */
@media (max-width: 768px) {
  #services .service-grid {
    grid-template-columns: 1fr !important;
  }
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  scroll-behavior: smooth;
  background: linear-gradient(
    180deg,
    var(--color-background) 0%,
    var(--color-background) 50%,
    var(--color-background-dark) 100%
  );
  min-height: 100vh;
}

/* Add scroll padding to account for fixed navbar */
html {
  scroll-padding-top: 75px; /* Slightly more than navbar height (70px) */
}

@media (max-width: 768px) {
  html {
    scroll-padding-bottom: 100px; /* Adjusted for mobile navbar height (60px) */
  }
}

body {
  font-family: "Roboto", sans-serif;
  font-optical-sizing: auto;
  color: var(--color-text);
  line-height: 1.6;
  position: relative;
}

/* Navbar Styles */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-card-bg);
  box-shadow: 0 1px 6px var(--color-shadow-light);
  z-index: 1000;
  border-bottom: 3px solid var(--color-secondary);
  height: 70px;
}

@media (max-width: 768px) {
  .navbar {
    position: fixed;
    bottom: 0;
    top: auto;
    width: 100%;
    height: 60px;
    border-bottom: none;
    border-top: 3px solid var(--color-secondary);
    box-shadow: 0 -1px 6px var(--color-shadow-light);
  }

  .navbar-container {
    flex-direction: row;
    padding: 0 15px;
    justify-content: space-around;
    height: 60px;
  }

  .nav-links {
    width: 100%;
    gap: 16px !important;
    justify-content: space-around;
  }

  .nav-links a {
    font-size: 12px;
    padding: 8px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  /* Hide all logo variations on mobile */
  .navbar-logo,
  .logo,
  .logo-link {
    display: none !important;
  }

  /* Adjust main content margins */
  main {
    margin: 0 !important;
    margin-bottom: 60px;
    padding-top: 5px;
  }

  footer {
    margin-bottom: 60px !important;
  }

  /* Adjust contact button size */
  .contact-button {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Extra small devices */
@media (max-width: 380px) {
  .nav-links a {
    font-size: 13px !important;
    padding: 6px 2px;
  }
}

/* Remove any other conflicting mobile navbar styles */
@media (max-width: 768px) {
  .about-content,
  .contact-content {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .service-grid {
    grid-template-columns: 1fr !important;
    gap: 30px;
    max-width: 100%;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
  }

  .service-card {
    padding: 20px 15px;
    width: 100%;
    box-sizing: border-box;
  }

  .container {
    width: 100%;
    max-width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
  }

  .projects-container {
    padding: 0 15px;
    box-sizing: border-box;
  }

  .hero-container {
    flex-direction: column;
    text-align: center;
  }

  .hero-content {
    text-align: center;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1.9rem;
    line-height: 1.3;
  }

  .company-name {
    font-size: 2.3rem;
  }

  .hero-logo {
    margin-bottom: 30px;
  }

  .hero-logo img {
    max-width: 260px;
  }

  .section {
    padding: 20px 0 60px;
  }

  .contact-content {
    padding: 0 15px;
  }

  .contact-info {
    padding: 20px;
  }

  .contact-detail {
    margin-bottom: 20px;
  }

  .specialty-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .specialty-icon {
    width: auto;
    height: auto;
  }

  .specialty-icon svg {
    width: 40px;
    height: 40px;
  }
}

main {
  margin-top: 70px; /* Reduced from 90px to match navbar height */
  padding-top: 5px; /* Reduced from 15px to shrink the gap */
}

/* Hero Section */
.hero {
  margin-top: 5px; /* Reduced from 15px */
  margin-bottom: 20px;
  padding: 60px 0;
  background: linear-gradient(
    135deg,
    #080808,
    #181818 35%,
    #333333 50%,
    #181818 65%,
    #080808
  );
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.6);
  margin: 10px 40px 20px; /* Top margin reduced from 30px to 10px */
  transition: transform 0.2s ease;
  will-change: transform;
  transform-style: preserve-3d;
}

/* Only apply hover effects on non-mobile devices */
@media (min-width: 769px) {
  .hero:hover {
    transform: perspective(1000px) rotateX(2deg);
  }

  .hero:hover::after {
    opacity: 1;
    transform: translateX(5px) translateY(-5px);
  }

  .hero:hover .hero-gloss {
    opacity: 1;
  }
}

/* Remove default hover styles on mobile */
@media (max-width: 768px) {
  .hero {
    transform: none !important;
    transition: none;
    will-change: auto;
    transform-style: flat;
  }

  .hero-gloss {
    display: none;
  }
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0) 35%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(0, 0, 0, 0) 65%
  );
  pointer-events: none;
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Move these hover selectors to the media query above */
.hero-gloss {
  position: absolute;
  top: 0;
  left: 0;
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 200, 0.05) 0%,
    rgba(255, 245, 180, 0.03) 30%,
    rgba(255, 220, 150, 0.01) 60%,
    rgba(255, 255, 255, 0) 75%
  );
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.3s ease;
  will-change: transform;
}

.navbar-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 70px;
}

.logo {
  position: absolute;
  left: 20px;
  height: 50px;
  display: flex;
  align-items: center;
}

/* Hide navbar logo by default */
.navbar-logo {
  display: flex;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* Will be toggled via JavaScript when scrolled */
.navbar-logo.show {
  opacity: 1;
  visibility: visible;
}

.logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 5px;
  cursor: pointer;
}

.logo img {
  height: 100%;
  width: auto;
  max-width: 120px; /* Reduced from 140px */
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center;
  align-items: center;
  gap: 40px;
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  padding: 8px 4px 4px; /* More padding on top to push text down */
  position: relative;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: inline-block;
}

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

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

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

/* Contact button styling */
.contact-button {
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.contact-button:hover {
  background-color: #005a88;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 108, 162, 0.3);
}

/* Responsive adjustments for contact button */
@media (max-width: 768px) {
  .contact-button {
    padding: 6px 12px;
    font-size: 13px;
  }
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
}

/* Logo section with tagline */
.hero-logo-section {
  margin-bottom: 40px;
}

.hero-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.hero-logo img {
  height: auto;
  width: 100%;
  max-width: 500px;
}

.hero-tagline {
  color: var(--color-secondary);
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.5px;
}

/* Hero description */
.hero-description {
  max-width: 800px;
}

.hero-description p {
  font-size: 1.9rem;
  line-height: 1.4;
  margin: 0;
  font-weight: 400;
}

/* Responsive adjustments for hero */
@media (max-width: 768px) {
  .hero {
    border-radius: 10px;
    margin: 20px 30px 50px;
    padding: 50px 0;
  }

  .hero-logo img {
    max-width: 350px;
  }

  .hero-tagline {
    font-size: 1.5rem;
  }

  .hero-description p {
    font-size: 1.6rem;
    line-height: 1.4;
  }
}

@media (max-width: 480px) {
  .hero {
    border-radius: 8px;
    margin: 15px 15px 40px;
    padding: 40px 0;
  }

  .hero-logo img {
    max-width: 280px;
  }

  .hero-tagline {
    font-size: 1.3rem;
  }

  .hero-description p {
    font-size: 1.4rem;
  }
}

/* Background utility classes - more specific and with !important */
.bg-dark {
  background-color: var(--color-background-dark) !important;
  color: var(--color-text-white) !important;
}

.bg-light {
  background-color: var(--color-background) !important;
}

.bg-alt {
  background-color: var(--color-background-alt) !important;
}

/* Ensure bg-alt applies to specific sections with highest priority */
section.section.bg-alt,
section#services.bg-alt,
section#about.bg-alt,
section.about-section.bg-alt {
  background-color: var(--color-background-alt) !important;
}

/* Fix for footer */
footer.bg-light {
  background-color: var(--color-background) !important;
  border-top: 1px solid var(--color-border);
}

/* Section Styles */
.section {
  padding: 20px 0 60px;
}

/* Remove all of these specific section overrides since we'll use classes instead */
#services,
#projects,
#specialties,
#about,
#contact {
  /* No background override */
}

.section:nth-child(even):not(.about-section) {
  /* No background override */
}

/* About section styling will come from bg-alt class */

.contact-section {
  padding: 60px 0 50px;
  margin-bottom: 0;
}

.projects-section {
  padding: 40px 0;
  overflow: hidden; /* Prevents horizontal scrollbar */
  margin-bottom: 20px;
}

.projects-section .container {
  max-width: 100%;
  padding: 0;
  width: 100%;
}
/* Footer */
footer {
  padding: 12px 0;
}

footer.bg-dark {
  background-color: var(--color-background-dark);
  color: var(--color-text-white);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  padding: 0 20px;
}

.footer-content p {
  margin: 3px 0;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.3px;
}

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

/* Card Gradient - Reusable glass-like styling */
.card-gradient {
  background: linear-gradient(160deg, var(--color-card-bg), #e0ecf8);
  border: 1px solid rgba(0, 108, 162, 0.2);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--color-shadow), 0 1px 3px rgba(0, 108, 162, 0.15);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.card-gradient:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 18px var(--color-shadow-hover),
    0 2px 5px rgba(0, 108, 162, 0.2);
}

/* Dark theme variant for dark backgrounds */
.card-gradient-dark {
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.15),
    rgba(0, 108, 162, 0.25)
  );
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 1px 5px rgba(0, 0, 0, 0.3);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.card-gradient-dark:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Disable hover animations on mobile */
@media (max-width: 768px) {
  .card-gradient:hover,
  .card-gradient-dark:hover,
  .specialty-item:hover,
  .project-card:hover,
  .contact-card:hover,
  .modal-nav-button:hover,
  .modal-close:hover {
    transform: none;
    box-shadow: inherit;
  }

  .specialty-item:hover .specialty-icon {
    transform: none;
  }
}

/* Responsive design */
@media (max-width: 1024px) {
  .service-grid {
    grid-template-columns: repeat(
      2,
      1fr
    ); /* Medium screens: 2 columns (3 rows of 2) */
    gap: 35px;
  }

  .hero-logo img {
    max-width: 340px;
  }

  .logo img {
    max-width: 140px;
  }

  .specialty-grid {
    grid-template-columns: repeat(3, 1fr); /* 3 columns for medium screens */
  }
}

@media (max-width: 480px) {
  main {
    margin-top: 60px;
    padding-top: 5px; /* Even smaller padding on very small screens */
  }

  .specialty-grid {
    grid-template-columns: 1fr; /* 1 column for mobile */
  }
}

/* Services Section */
.service-grid {
  display: grid;
  grid-template-columns: repeat(
    3,
    1fr
  ); /* Large screens: 3 columns (2 rows of 3) */
  gap: 40px; /* Simplified gap */
  margin-top: 40px;
}

/* Tablet-specific override for services */
@media (min-width: 769px) and (max-width: 1024px) {
  .service-grid {
    grid-template-columns: repeat(
      2,
      1fr
    ) !important; /* 2 columns for tablets */
    gap: 35px;
  }
}

.service-card {
  padding: 30px;
  display: flex;
  flex-direction: column;
  height: auto;
  overflow: visible; /* Ensure content doesn't get cut off */
}

.service-card h3 {
  color: var(--color-primary);
  margin-top: 0;
  margin-bottom: 15px;
}

.service-card p {
  margin-bottom: 0;
}

/* Specialties Section */
.specialty-grid {
  display: grid;
  grid-template-columns: repeat(
    4,
    1fr
  ); /* 4 columns maximum for large screens */
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Responsive adjustments for the specialty grid */
@media (max-width: 1100px) {
  .specialty-grid {
    grid-template-columns: repeat(
      3,
      1fr
    ); /* 3 columns for medium-large screens */
  }
}

@media (max-width: 768px) {
  .specialty-grid {
    grid-template-columns: repeat(
      2,
      1fr
    ); /* 2 columns for tablets/medium screens */
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .specialty-grid {
    grid-template-columns: repeat(2, 1fr); /* Keep 2 columns minimum */
    gap: 15px;
  }

  .specialty-item {
    padding: 15px 10px; /* Smaller padding for mobile */
  }

  .specialty-icon svg {
    width: 35px;
    height: 35px;
  }

  .specialty-item h3 {
    font-size: 1rem;
  }
}

.specialty-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 25px 20px;
  text-align: center;
}

.specialty-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px var(--color-shadow-hover);
}

.specialty-icon {
  width: auto;
  height: auto;
  background-color: transparent;
  border-radius: 0;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-secondary);
  transition: all 0.3s ease;
}

.specialty-item:hover .specialty-icon {
  background-color: transparent;
  transform: scale(1.1);
}

.specialty-icon svg {
  width: 45px;
  height: 45px;
  stroke-width: 1.5px;
}

.specialty-item h3 {
  margin: 0;
  color: var(--color-primary);
  font-size: 1.2rem;
}

/* Team styling */
.team-container {
  display: flex;
  gap: 30px;
  max-width: 1100px;
  margin: 0 auto;
}

.team-members-list {
  flex: 0 0 40%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.team-member {
  display: flex;
  align-items: center;
  padding: 12px;
  cursor: pointer;
  border-left: 4px solid transparent;
  min-height: 60px;
  background: linear-gradient(160deg, transparent, rgba(0, 108, 162, 0.05));
  transition: all 0.3s ease;
}

.team-member.active {
  border-left-color: var(--color-secondary);
  background: linear-gradient(
    160deg,
    rgba(0, 108, 162, 0.05),
    rgba(0, 108, 162, 0.15)
  );
}

.team-photo {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border-radius: 50%;
  margin-right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-placeholder);
}

.team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.team-photo img[src="placeholder.svg"] {
  object-fit: contain;
  width: 60%;
  height: 60%;
}

.team-info {
  display: flex;
  align-items: center;
  flex: 1;
}

.team-info-text {
  flex: 1;
}

.team-info h3 {
  margin: 0;
  color: var(--color-primary);
  font-size: 1.1rem;
}

.team-title {
  font-weight: 600;
  color: var(--color-secondary);
  margin: 0;
  font-size: 0.9rem;
}

.team-bio-panel {
  flex: 0 0 55%;
}

.bio-content {
  padding: 25px;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: linear-gradient(160deg, transparent, rgba(0, 108, 162, 0.05));
  height: 100%;
  position: relative;
}

.bio-content.active {
  display: block;
  opacity: 1;
  border-left: 3px solid var(--color-secondary);
  background: linear-gradient(
    160deg,
    rgba(0, 108, 162, 0.05),
    rgba(0, 108, 162, 0.15)
  );
}

.bio-header {
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-secondary);
  padding: 0 0 12px 0;
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.bio-header h3 {
  margin: 0;
  color: var(--color-primary);
  font-size: 1.5rem;
}

.bio-title {
  margin: 0;
  color: var(--color-secondary);
  font-weight: 600;
  font-size: 1rem;
}

.bio-contact {
  margin-left: auto;
  display: flex;
  gap: 12px;
}

.contact-icon {
  color: var(--color-secondary);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(100, 166, 10, 0.1);
}

.contact-icon:hover {
  color: var(--color-primary);
  background-color: rgba(0, 108, 162, 0.1);
  transform: scale(1.1);
}

.contact-icon svg {
  width: 20px;
  height: 20px;
}

.bio-text {
  line-height: 1.6;
  color: var(--color-text);
  padding-top: 10px;
}

.bio-text p {
  margin: 0 0 8px 0;
  font-size: 17px;
}

/* Team contact button styling */
.team-contact-button-container {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.team-contact-button {
  min-width: 180px;
}

/* Responsive styles for the team section */
@media (max-width: 900px) {
  .team-container {
    flex-direction: column;
  }

  .team-members-list {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .team-bio-panel {
    flex: 1 1 auto;
  }
}

@media (max-width: 600px) {
  .team-members-list {
    grid-template-columns: 1fr;
  }

  /* Add mobile-specific title for James */
  .team-member[data-member="james"] .team-title {
    font-size: 0.8rem;
  }

  .team-member[data-member="james"] .team-title::before {
    content: "S. Safety Manager";
    display: block;
  }

  .team-member[data-member="james"] .team-title span {
    display: none;
  }

  .team-member {
    flex-direction: column;
  }

  .team-info {
    display: flex;
    align-items: center;
    width: 100%;
  }

  .team-info-text {
    flex: 1;
  }

  .team-info h3 {
    font-size: 0.95rem;
    margin-bottom: 2px;
  }

  .team-title {
    font-size: 0.8rem;
    margin: 0;
  }

  .team-contact-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .team-caret {
    display: flex;
    align-items: center;
  }

  .team-member.active .team-caret i {
    transform: rotate(180deg);
  }

  .team-bio-panel {
    display: none; /* Hide the separate bio panel on mobile */
  }

  .bio-content {
    display: block;
    padding: 0 15px;
    margin-top: 0;
    border-top: 3px solid var(--color-secondary);
    border-left: none !important;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    background: none !important;
  }

  .bio-content.active {
    opacity: 1;
    padding: 15px;
    margin-top: 15px;
  }

  .team-member {
    padding: 12px;
    position: relative;
    transition: all 0.3s ease-in-out;
  }

  .team-member.active::after {
    transform: translateY(-50%) rotate(-135deg);
  }

  .bio-text {
    padding-top: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s ease-in-out;
  }

  .bio-content.active .bio-text {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (min-width: 601px) {
  .team-member {
    flex-direction: row;
  }

  .team-info {
    flex-direction: row;
    padding-right: 0;
  }

  .team-info-text {
    padding-right: 15px;
  }

  .team-member .bio-content {
    display: none; /* Hide mobile bio content on desktop */
  }

  .team-member::after {
    display: none; /* Hide arrow on desktop */
  }

  .team-contact-mobile {
    display: none !important; /* Explicitly hide on tablet/desktop */
  }
}

.section h2 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 40px;
  color: var(--color-primary);
  font-size: 2rem;
}

.about-text {
  max-width: 800px;
  margin: 0 auto 40px;
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.6;
  text-wrap: balance;
  padding: 0 15px;
  hyphens: auto;
}

.about-text p {
  margin-bottom: 1.2em;
  word-break: normal;
  overflow-wrap: break-word;
}

@media (max-width: 768px) {
  .projects-section {
    padding: 30px 0;
  }

  .projects-container {
    padding: 0;
    width: 100%;
    margin: 0;
  }

  .projects-row {
    gap: 15px; /* Slightly reduced gap on mobile */
  }
}

/* Custom class to force single column on mobile */
@media (max-width: 768px) {
  .mobile-single-column {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }

  .mobile-single-column .service-card {
    width: 100% !important;
  }
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  transform: translate3d(0, 0, 0); /* Force GPU layer */
  backface-visibility: hidden;
  will-change: opacity, visibility;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0s linear;
}

.modal-overlay.closing {
  opacity: 0;
  visibility: visible;
  transition: opacity 0.3s ease;
}

.modal-overlay.closing .modal-content {
  transform: scale(0.95);
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 60px;
  background-color: black;
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-image-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.modal-image {
  display: block;
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  transition: transform 0.3s ease;
}

/* Image error fallback */
.image-error {
  background-color: #f0f0f0;
  opacity: 0; /* Hide the actual broken image */
  position: relative;
}

.image-error::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f0f0f0;
  z-index: 2;
}

.modal-image-container.has-error {
  background-color: #f0f0f0;
  width: 800px;
  height: 600px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Responsive adjustments for error container */
@media (max-width: 900px) {
  .modal-image-container.has-error {
    width: 600px;
    height: 450px;
  }
}

@media (max-width: 650px) {
  .modal-image-container.has-error {
    width: 90vw;
    height: 60vh;
  }
}

/* Mobile styles override */
@media (max-width: 767px) {
  .modal-overlay.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .modal-image {
    max-height: 60vh; /* Reduce height to make room for bottom nav */
  }

  .modal-image-container {
    max-height: 60vh;
  }

  .modal-content {
    width: 95%;
    max-width: 95%;
    margin-top: 0;
    margin-bottom: 0;
    flex-direction: column;
    padding-bottom: 0; /* Remove padding-bottom */
    position: relative;
  }

  .modal-navigation {
    position: fixed;
    top: auto;
    bottom: 20px;
    left: 0;
    right: 0;
    padding: 0 10px;
    height: auto;
  }

  .modal-nav-content {
    width: auto;
    justify-content: center;
    padding: 6px 10px;
    max-width: 340px; /* Increased from 320px */
    margin: 0 auto;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  }

  .modal-close {
    font-size: 20px;
  }

  .modal-counter {
    font-size: 16px;
    width: 60px; /* Increased from 50px */
  }

  .modal-project-info {
    order: -1;
    position: relative;
    padding: 12px;
    background-color: rgba(0, 0, 0, 0.8);
  }

  .modal-nav-divider {
    height: 20px;
  }
}

.modal-navigation {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  width: 100%;
  height: 56px; /* Fixed height for the entire navigation bar */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2001;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px; /* Reduced padding since close button is now inside */
  box-sizing: border-box;
}

.modal-nav-content {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 8px 12px;
  border-radius: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  height: 40px; /* Fixed height to match buttons */
}

.modal-nav-divider {
  width: 1px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.3);
  margin: 0 4px;
}

.modal-nav-button,
.modal-close {
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  font-size: 18px;
}

.modal-close {
  font-size: 22px; /* Slightly larger X symbol */
}

.modal-nav-button:hover,
.modal-close:hover {
  background-color: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

.modal-counter {
  color: white;
  font-size: 18px;
  font-weight: 500;
  width: 70px; /* Increased from 60px */
  text-align: center;
  letter-spacing: 1px;
  line-height: 40px; /* Match height of buttons */
}

/* Mobile styles override */
@media (max-width: 767px) {
  .modal-navigation {
    top: auto;
    bottom: 20px;
    padding: 0 10px;
  }

  .modal-nav-content {
    width: auto;
    justify-content: center;
    padding: 6px 10px;
    max-width: 340px; /* Increased from 320px */
    margin: 0 auto;
  }

  .modal-close {
    font-size: 20px;
  }

  .modal-counter {
    font-size: 16px;
    width: 60px; /* Increased from 50px */
  }

  .modal-project-info {
    order: -1;
    position: relative;
    padding: 12px;
    background-color: rgba(0, 0, 0, 0.8);
  }

  .modal-nav-divider {
    height: 20px;
  }
}

.modal-prev,
.modal-next {
  user-select: none;
}

/* Add swipe area */
.modal-swipe-area {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.modal-project-info {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
}

.modal-project-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 5px 0;
}

.modal-project-location {
  font-size: 0.9rem;
  opacity: 0.8;
  margin: 0;
}

/* Make project cards clickable */
.project-card {
  height: 180px;
  width: 260px;
  flex-shrink: 0;
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--color-primary);
}

/* Contact Section */
.contact-section h2 {
  color: var(--color-text-white) !important;
  margin-bottom: 40px;
}

.contact-grid {
  display: flex;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 30px;
}

.contact-column {
  flex: 1 1 300px;
  max-width: 350px;
  padding: 0 10px;
  display: flex;
  box-sizing: border-box;
}

.contact-card {
  padding: 30px 20px;
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 250px;
}

.contact-card:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  transform: none;
}

/* Card title styling */
.card-title {
  text-align: center;
  margin-bottom: 0;
  position: relative;
  padding-bottom: 25px;
  width: 100%;
}

.card-title h3 {
  font-size: 22px;
  margin: 0;
  color: var(--color-text-white);
  display: inline-block;
}

.card-title:after {
  content: "";
  position: absolute;
  bottom: 10px;
  left: 5%;
  right: 5%;
  width: 90%;
  height: 3px;
  background-color: var(--color-secondary);
}

/* Card content styling */
.card-content {
  text-align: left;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-top: 5px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  margin: 0;
  font-size: 18px;
  color: var(--color-text-white);
}

.contact-icon {
  color: var(--color-secondary);
  flex-shrink: 0;
  margin-top: 3px;
}

.contact-card a {
  color: var(--color-text-white);
  text-decoration: none;
  transition: color 0.3s ease;
  font-weight: 500;
  font-size: 18px;
}

.contact-card a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Media queries for contact section */
@media (max-width: 900px) {
  .contact-grid {
    max-width: 800px;
  }

  .contact-column {
    flex: 1 1 300px;
    max-width: none;
  }
}

@media (max-width: 768px) {
  .contact-grid {
    flex-direction: column;
    gap: 30px;
    align-items: center;
  }

  .contact-column {
    flex: 0 0 100%;
    max-width: 500px;
    width: 100%;
    padding: 0;
  }

  .contact-card {
    padding: 25px 20px;
    min-height: 0;
  }

  /* Adjust title line on mobile */
  .card-title:after {
    left: 0;
    right: 0;
    width: 100%;
  }
}

/* Projects Section */
.projects-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

.projects-row {
  display: flex;
  gap: 20px;
  width: max-content;
  padding: 5px 0;
}

/* Animation for left-moving row */
.projects-row-left {
  animation: scrollLeft 90s linear infinite;
}

/* Animation for right-moving row */
.projects-row-right {
  animation: scrollRight 90s linear infinite;
}

/* Pause animations when section is not in viewport for performance */
.projects-section:not(.in-viewport) .projects-row-left,
.projects-section:not(.in-viewport) .projects-row-right {
  animation-play-state: paused;
}

/* Pause animation on hover */
.projects-row:hover {
  animation-play-state: paused;
}

/* Add delay when resuming animation */
.projects-row {
  transition: none; /* Reset any existing transitions */
}

.projects-row:not(:hover) {
  transition: animation-play-state 0s 2s; /* 2s delay before resuming */
}

@keyframes scrollLeft {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-50% - 10px));
  }
}

@keyframes scrollRight {
  0% {
    transform: translateX(calc(-50% - 10px));
  }
  100% {
    transform: translateX(0);
  }
}

.project-card {
  height: 180px;
  width: 260px;
  flex-shrink: 0;
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--color-primary);
}

.project-image {
  position: relative;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.project-title {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 10px 15px;
  background-color: var(--color-overlay);
  color: var(--color-text-white);
  font-weight: 600;
  font-size: 16px;
}

.project-location {
  position: absolute;
  bottom: 0;
  right: 0;
  padding: 8px 12px;
  background-color: var(--color-overlay);
  color: var(--color-text-white);
  font-size: 13px;
  border-top-left-radius: 8px;
}

/* Responsive design for projects */
@media (max-width: 768px) {
  .project-card {
    height: 160px; /* Smaller on mobile (was 180px) */
    width: 220px; /* Smaller on mobile (was 250px) */
  }

  .project-title {
    font-size: 14px;
    padding: 8px 10px;
  }

  .project-location {
    font-size: 12px;
    padding: 6px 10px;
  }

  .projects-row-left,
  .projects-row-right {
    animation-duration: 60s; /* Slower on mobile (was 30s) */
  }
}

.hours-list p {
  margin: 5px 0;
}

/* Utility Classes */
.scroll-locked {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
}

/* Prevent scrolling when modal is open without using position: fixed */
.modal-open {
  overflow: hidden !important;
}

/* Keep projects rendered during modal */
.projects-row {
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
  will-change: transform;
  transition: none; /* Reset any existing transitions */
}

.projects-row-left {
  animation: scrollLeft 90s linear infinite;
  transform: translate3d(0, 0, 0); /* Force GPU acceleration */
}

.projects-row-right {
  animation: scrollRight 90s linear infinite;
  transform: translate3d(0, 0, 0); /* Force GPU acceleration */
}

/* Ensure modal appears above but doesn't affect rendering */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  transform: translate3d(0, 0, 0); /* Force GPU layer */
  backface-visibility: hidden;
  will-change: opacity, visibility;
}

/* Contact Drawer */
.contact-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  visibility: hidden;
  pointer-events: none;
}

.contact-drawer.visible {
  visibility: visible;
  pointer-events: auto;
}

.contact-drawer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.contact-drawer-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-background-dark);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  padding: 20px 0;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 75vh; /* Reduced from 90vh */
  overflow-y: auto;
  will-change: transform;
  z-index: 2001;
}

/* Drawer States */
.contact-drawer.visible .contact-drawer-overlay {
  opacity: 1;
}

.contact-drawer.visible .contact-drawer-content {
  transform: translateY(0);
}

.contact-drawer.closing .contact-drawer-overlay {
  opacity: 0;
}

.contact-drawer.closing .contact-drawer-content {
  transform: translateY(100%);
  transition: transform 0.2s cubic-bezier(0.4, 0, 1, 1);
}

.contact-drawer-icon {
  margin-right: 10px;
  color: var(--color-secondary);
  flex-shrink: 0;
  margin-top: 6px;
}

.contact-drawer .contact-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
  color: white;
}

.contact-drawer .contact-item a {
  max-width: calc(100% - 28px);
}

@media (min-width: 769px) {
  .contact-drawer .contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
  }
}

/* Mobile Styles */
@media (max-width: 768px) {
  .contact-drawer-content {
    padding-top: 15px;
    padding-bottom: 70px;
    user-select: none;
    touch-action: pan-x;
    max-height: 65vh;
  }

  .drawer-drag-handle {
    display: block;
    width: 120px;
    position: relative;
    margin: 0 auto 15px;
    cursor: grab;
    z-index: 10;
  }

  .drawer-drag-line {
    display: block;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 1px;
    transition: background-color 0.2s ease;
  }

  .drawer-drag-handle:active .drawer-drag-line {
    background-color: rgba(255, 255, 255, 0.7);
  }

  .contact-drawer-close {
    display: none;
  }

  /* Remove transitions during drag */
  .contact-drawer-content.dragging,
  .contact-drawer-overlay.dragging {
    transition: none;
  }

  /* Ensure drawer appears above bottom nav */
  .contact-drawer {
    z-index: 2000;
  }

  .contact-drawer-content {
    z-index: 2001;
  }
}

/* Close Button (Desktop only) */
.contact-drawer-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--color-text-white);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.contact-drawer-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Drawer Content Styling */
.contact-drawer .contact-grid {
  margin-top: 15px;
  gap: 20px;
}

.contact-drawer h2 {
  color: var(--color-text-white);
  margin-bottom: 20px;
  text-align: center;
}

.contact-drawer .contact-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
}

.contact-drawer .contact-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-drawer-address {
  margin-left: 0;
  flex-grow: 1;
  display: inline-block;
}

.contact-drawer-text {
  color: var(--color-text-white);
  text-decoration: none;
  transition: color 0.3s ease, opacity 0.3s ease;
  display: inline-block;
}

.contact-drawer-text:hover {
  color: var(--color-secondary);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .contact-drawer .contact-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 20px;
  }

  .contact-drawer .contact-column {
    width: 100%;
  }
}

/* Prevent body scroll when drawer is open */
body.drawer-open {
  overflow: hidden;
}

/* Add smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Prevent body scroll when drawer is open */
body.drawer-open {
  overflow: hidden;
}

.contact-card:before {
  /* Remove this entire block since it's now handled by card-gradient-dark */
}

@media (max-width: 600px) {
  .contact-icon {
    width: 32px;
    height: 32px;
  }

  .contact-icon svg {
    width: 18px;
    height: 18px;
  }
}

.team-contact-mobile {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.team-caret {
  display: none;
  color: var(--color-text);
  transition: transform 0.3s ease;
}

.team-member.active .team-caret i {
  transform: rotate(180deg);
}

@media (max-width: 600px) {
  .team-caret {
    display: flex;
    align-items: center;
  }

  .team-contact-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
  }
}

/* Tablet-specific styles for bio panel */
@media (min-width: 601px) and (max-width: 900px) {
  .team-bio-panel {
    height: 400px; /* Fixed height for tablet */
  }

  .bio-content {
    height: 100%;
    overflow-y: auto;
    /* Customize scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--color-secondary) transparent;
  }

  /* Webkit scrollbar styling */
  .bio-content::-webkit-scrollbar {
    width: 6px;
  }

  .bio-content::-webkit-scrollbar-track {
    background: transparent;
  }

  .bio-content::-webkit-scrollbar-thumb {
    background-color: var(--color-secondary);
    border-radius: 3px;
  }
}

.contact-drawer-address {
  margin-left: 28px; /* Align with the icon */
}

.contact-drawer-text {
  color: var(--color-text-white);
  text-decoration: none;
  transition: color 0.3s ease, opacity 0.3s ease;
}

.contact-drawer-text:hover {
  color: var(--color-secondary);
  text-decoration: underline;
}

.contact-drawer-text:active {
  opacity: 0.7;
}

.contact-drawer .contact-card {
  max-width: none;
  width: 100%;
}

/* Scroll to Top Button */
#scrollToTopBtn {
  display: none;
  position: fixed;
  bottom: 75px;
  right: 15px;
  z-index: 999;
  border: none;
  outline: none;
  background-color: var(--color-primary);
  color: white;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease,
    background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#scrollToTopBtn {
  display: flex;
}
#scrollToTopBtn.show {
  opacity: 1;
  visibility: visible;
}
/* Hide button when drawer is open */
body.drawer-open #scrollToTopBtn {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#scrollToTopBtn {
  display: none !important;
}
