/* ===================================================================== */
/* == General Section ==
/* ===================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --background: #F1F1F1;
  --text-color: #767676;
  --font-main: 'Roboto';
}

html {
  margin: 0;
  padding: 0;
  font-size: 16px;
  line-height: 1.5;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background-color: var(--background);
  color: var(--text-color);
}

/* ===================================================================== */
/* == Navigation Bar ==
/* ===================================================================== */
.main-header {
  background-color: transparent;
  position: absolute; /* Header is absolute to overlay hero section */
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 20px 30px;
}

.nav-container {
  background-color: #F1F1F1;
  border-radius: 12px;
  border: 1.2px solid #A9A9A9;
  padding: 8px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  max-width: 1200px;
  margin: 0 auto;
}

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

.logo-area img {
  height: 65px;      /* Fixed: moved from .logo-area */
  margin-right: 8px; /* Fixed: moved from .logo-area */
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.logo-area img:hover {
  transform: scale(1.2);
  opacity: 0.8;
}

.logo-link {
  display: block;
  line-height: 0;
  text-decoration: none;
}

.logo-link:hover img {  /* Fixed: targets img directly */
  transform: scale(1.05);
}

.brand-name {
  font-weight: bold;
  font-size: 2rem;
  color: #A9A9A9;
  text-shadow:
    -1px -1px 0 #C5E3EC,
    1px -1px 0 #C5E3EC,
    -1px 1px 0 #C5E3EC,
    1px 1px 0 #C5E3EC;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 25px;
}

.main-nav li {
  margin: 0;
}

.main-nav a {
  position: relative;
  font-size: 1.2rem;
  text-decoration: none;
  color: #767676;
  font-weight: 300;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 0;
  height: 5px;
  background: #90D5EC;
  transition: 0.3s ease;
}

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

.main-nav a:hover {
  color: #90D5EC;
}

/* ===================================================================== */
/* == Footer Section ==
/* ===================================================================== */

.footer {
  background-color: #8c8c8c;
  text-align: center;
  padding: 20px 0 23px 0; /* Added 3px to bottom padding */
  margin-top: 50px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.25rem; 
  flex-wrap: nowrap;
}

.footer-socials {
  display: flex;
  justify-content: center;
}

.footer-socials a img {
  height: 40px;
  width: 40px; 
  margin: 0 0.5rem;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.footer-socials a img:hover {
  transform: scale(1.2);
  opacity: 0.8;
}

.footer-separator {
  width: 60%;
  height: 1px;
  background-color: #A9A9A9;
  opacity: 0.6;
  margin: 0.25rem 0;
}

.footer-bottom p {
  margin: 0;
  font-size: 13px;
  color: #F1F1F1;
}

/* ===================================================================== */
/* == Home Section - Shared Styles ==
/* ===================================================================== */

/* Shared section styles */
.section {
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #A9A9A9;
  text-align: center;
  position: relative;
  padding: 4rem 2rem 4rem;
}

.section.gradient-purple { background: linear-gradient(to right, #8A2BE2, #6A5ACD, #324AB2); margin-top: 150px; }
.section.gradient-blue  { background: linear-gradient(to right, #324AB2, #6A5ACD, #8A2BE2); }
.section.gradient-light { background: linear-gradient(to right, #F1F1F1, #DCDCDC, #F1F1F1); }

/* FIX: Remove gaps between sections */
.explain-section,
.stack-section {
  margin-top: 0 !important;
}

/* Shared container */
.container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1300px;
  width: 100%;
  gap: 3rem;
}
.container.wide-gap { gap: 5rem; }

/* Shared content side */
.content {
  flex: 1;
  min-width: 300px;
}
.content h1.light { font-size: 3.5rem;  font-weight: 300; margin-bottom: 3rem; color: #F1F1F1; }
.content h1.blue  { font-size: 3rem;  font-weight: 300; margin-bottom: 1.5rem; color: #324AB2; }
.content h2.light { font-size: 1.2rem;  font-weight: 300; margin-bottom: 2rem; color: #D3D3D3; }
.content h2.purple{ font-size: 1.2rem;  font-weight: 300; margin-bottom: 2rem; color: #6A5ACD; }

/* Shared image side */
.image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}
.image img { max-width: 85%; height: auto; border-radius: 0; box-shadow: none; }

/* Shared button list */
.list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
}

/* Button styles */
.list li {
  flex: 1;
  background-color: #A9A9A9;
  color: #F1F1F1;
  padding: 0.75rem 1rem;
  border-radius: 5px;
  font-size: 1.2rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, background-color 0.3s ease;
  min-width: 180px;
}
.list li:hover {
  transform: scale(1.05) translateY(-3px);
  opacity: 0.9;
}

/* Section-specific overrides */
.core-section    .list li      { min-width: 180px; }
.explain-section .list         { gap: 1rem; }
.explain-section .list li      { min-width: 130px; font-size: 1.1rem; border-radius: 6px; }
.explain-section .list li:hover{ background-color: #8A2BE2; }
.core-section    .list li:hover{ background-color: #90D5EC; }


/* ===================================================================== */
/* == About Section - Inherits from Home ==
/* ===================================================================== */

/* About Section - New Gradient */
.section.gradient-light-gray { 
  background: linear-gradient(to right, #DCDCDC, #F1F1F1, #DCDCDC); 
  margin-top: 150px; 
}

/* About-specific overrides */
.about-section .image img { max-width: 100%; }
.about-section .content h1 { font-size: 3rem; font-weight: 300; }
.about-section .content h2 { text-align: left; }

/* ===================================================================== */
/* == Lab Section - Inherits from Home ==
/* ===================================================================== */

.section.gradient-blue { 
  background: linear-gradient(to right, #324AB2, #6A5ACD, #8A2BE2); 
  margin-top: 150px; 
  padding: 2rem 2rem; /* Intro-specific padding */
}

/* Intro-specific container */
.intro-container {
  max-width: 900px;
  width: 100%;
}

/* New text classes */
.intro-section h2.light-bold { 
  font-weight: 700; 
  font-size: 2.5rem; 
  color: #F1F1F1; 
  margin-bottom: 0.75rem; 
}
.lab-section h2.dark-bold { 
  font-weight: 700; 
  font-size: 2.5rem; 
  color: #3C3C3C; 
  margin-bottom: 0.75rem; 
}
.intro-section p.light-para { 
  font-size: 1.1rem; 
  color: #F1F1F1; 
  line-height: 1.6; 
  opacity: 0.9; 
}
.lab-section p.dark-para { 
  font-size: 1.1rem; 
  color: #4F4F4F;
  text-align: left; 
  line-height: 1.6; 
  opacity: 0.9; 
}

.lab-divider {
  border: none;
  height: 3px;
  width: 85%;
  margin: auto;
  background: linear-gradient(
    to left,
    transparent,
    rgba(106, 90, 205, 0.6),
    transparent
  );
}

/* Lab-specific overrides */
.lab-section .image img,
.lab-section .content { min-width: 300px; }

/* ===================================================================== */
/* == Contact Section - Inherits from Home ==
/* ===================================================================== */

.section.gradient-blue.contact-section { 
  padding: 3rem 2rem; 
  margin-top: 150px; 
}

/* Contact container override */
.container.contact-container {
  max-width: 1400px;
  justify-content: flex-start;
  gap: 4rem;
}

/* Contact image */
.contact-section .image.contact-image { 
  gap: 0.5rem; 
}
.contact-section .image.contact-image img { 
  max-width: 85%; 
}

.contact-section h2.light-bold { 
  font-weight: 700;
  font-size: 2.5rem;
  color: #F1F1F1; 
  margin-bottom: 0.5rem;
}
.contact-section p.light-para { 
  font-size: 1.1rem;
  color: #F1F1F1;
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: 2rem;
}

/* ==================== IMPROVED E-MAIL FORM ===================== */
/* Grouped selectors + modern defaults, same functionality */

.contact-form {
  --input-color: #767676;
  --border-color: #A9A9A9;
  --focus-glow: #90D5EC;
  --form-gap: 1rem;
  
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: var(--form-gap);
  color: #F1F1F1;
  text-align: left;
}

/* Unified input/textarea styling */
.contact-form input,
.contact-form textarea {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border-color);
  color: var(--input-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;  /* Modern best practice */
  resize: vertical;
}

.contact-form textarea {
  min-height: 120px;
}

/* Email autofill fix (unchanged - essential) */
.contact-form input[type="email"] { color: var(--input-color); }
.contact-form input:-webkit-autofill {
  -webkit-text-fill-color: var(--input-color) !important;
  transition: background-color 9999s ease-in-out 0s;
}

/* Focus states */
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--border-color);
  outline: none;
  box-shadow: 0 0 8px var(--focus-glow);
}

/* Labels */
.contact-form label {
  font-weight: 500;
  margin-bottom: 0.1rem;
  display: block;  /* Ensures proper layout */
}

/* Button (modernized hover) */
.btn-submit {
  background-color: #A9A9A9;
  color: #fff;
  border: none;
  padding: 0.85rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;  /* Smoother transitions */
  align-self: flex-start;
}

.btn-submit:hover,
.btn-submit:focus {
  background-color: #C5E3EC;
  transform: translateY(-1px);  /* Subtle lift effect */
  outline: none;
  box-shadow: 0 4px 12px rgba(144, 213, 236, 0.4);
}

/* Errors & Alerts (unchanged - perfect as-is) */
.contact-form-error {
  color: red;
  font-size: 0.9em;
  margin-top: 3px;
  display: block;
}

.flash-messages .alert {
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 4px;
  text-align: center;
}
.alert-success { background-color: #d4edda; color: #155724; }
.alert-danger { background-color: #f8d7da; color: #721c24; }

/* ===================================================================== */
/* == RESPONSIVE + ACCESSIBILITY ==
/* ===================================================================== */

/* Mobile-first tablets (768px and up) */
@media (max-width: 768px) {
  .section,
  .container,
  .intro-section .intro-container {
    flex-direction: column;
    gap: 2rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  
  .content,
  .image {
    min-width: unset;
    text-align: center;
  }
  
  /* Typography scaling */
  .content h1.light,
  .content h1.blue,
  h2.light-bold,
  h2.dark-bold {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
  }
  
  .content h2.light,
  .content h2.purple,
  p.light-para,
  p.dark-para {
    font-size: clamp(1rem, 4vw, 1.2rem);
  }
  
  .list {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .list li {
    min-width: unset;
    width: 100%;
  }
}

/* Small mobile (480px and below) */
@media (max-width: 480px) {
  .section {
    padding: 2.5rem 1rem;
    margin-top: 100px;
  }
  
  .container {
    gap: 1.5rem;
  }
  
  .container.wide-gap,
  .contact-container {
    gap: 2.5rem;
  }
  
  /* Enhanced touch targets */
  .list li,
  .btn-submit {
    min-height: 48px;  /* WCAG touch target minimum */
    padding: 1rem;
  }
  
  /* Full-width button on mobile */
  .btn-submit {
    width: 100%;
    align-self: stretch;
  }
}

/* High DPI / Zoom support */
@media (max-width: 768px), (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .image img {
    max-width: 95%;
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .list li:hover,
  .btn-submit:hover {
    transform: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .contact-form input,
  .contact-form textarea {
    border-width: 2px;
    border-color: #000;
  }
  
  .btn-submit {
    border: 2px solid #000;
  }
}

/* Print styles */
@media print {
  .section,
  .container {
    break-inside: avoid;
  }
  
  .list li,
  .btn-submit {
    box-shadow: none;
    background: #eee;
  }
}
