/*! Modern Enhanced Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/*! Performance optimizations */
* {
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

/* Hardware acceleration for smooth animations */
.scroll-animation,
.main-header .text,
.main-header .image,
.feature-section,
.tab-card,
.navbar {
  transform: translateZ(0);
  will-change: transform, opacity;
}

.audio-wide {
  font-family: 'Audiowide', cursive;
}

.barlow {
  font-family: 'Barlow', sans-serif;
}

.exo {
  font-family: 'Exo', sans-serif;
}

.public-sans {
  font-family: 'Public Sans', sans-serif;
}

.montserrat {
  font-family: 'Montserrat', Arial, sans-serif;
}

/*! Variables for modern design */
:root {
  --primary-cyan: #CCE9E7;
  --dark-bg: #0a0a0f;
  --card-bg: rgba(204, 233, 231, 0.05);
  --border-glow: rgba(204, 233, 231, 0.3);
  --text-primary: #CCE9E7;
  --text-secondary: rgba(204, 233, 231, 0.8);
  --glass-bg: rgba(255, 255, 255, 0.02);
  --shadow-glow: 0 8px 32px rgba(204, 233, 231, 0.1);
  --shadow-heavy: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/*! Modern body with animated background */
body {
  background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
  font-family: 'Montserrat', Arial, sans-serif;
  line-height: 1.6;
  padding-bottom: 2rem;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(204, 233, 231, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 80% 20%, rgba(204, 233, 231, 0.06) 0%, transparent 50%),
              radial-gradient(circle at 40% 80%, rgba(204, 233, 231, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
  opacity: 0.6;
  will-change: auto;
}

/* Removed heavy background pulse animation for better performance */

/*! Smooth scrolling and performance */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/*! Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-cyan) 0%, #a8d5d3 100%);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #a8d5d3 0%, var(--primary-cyan) 100%);
}

/*! Modern Navigation */
.navbar {
  margin-top: 2rem;
  margin-bottom: 2rem;
  width: 100%;
  display: flex;
  justify-content: space-between;
  backdrop-filter: blur(10px);
  background: var(--glass-bg);
  border-radius: 20px;
  padding: 1rem 2rem;
  border: 1px solid var(--border-glow);
  box-shadow: var(--shadow-glow);
  transition: all 0.3s ease;
  position: sticky;
  top: 1rem;
  z-index: 100;
}

.navbar:hover {
  box-shadow: 0 12px 40px rgba(204, 233, 231, 0.15);
  transform: translateY(-2px);
}

.navbar img {
  transition: transform 0.3s ease;
}

.navbar img:hover {
  transform: scale(1.05);
}

.social-link-container {
  display: flex;
  position: relative;
  right: 0;
  height: 48px;
  border-radius: 15px;
  border: 2px solid var(--border-glow);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
  padding: 4px;
  transition: all 0.3s ease;
}

.social-link-container:hover {
  box-shadow: 0 8px 25px rgba(204, 233, 231, 0.2);
  transform: translateY(-2px);
}

.social-links {
  width: 40px;
  height: 40px;
  text-align: center;
  position: relative;
  font-size: 20px;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-links:hover {
  background: var(--primary-cyan);
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 8px 20px rgba(204, 233, 231, 0.3);
}

.social-links i {
  background: transparent;
  color: var(--primary-cyan);
  transition: all 0.3s ease;
}

.social-links:hover i {
  color: #000;
}

/*! Alert animations */
.alert.alert-danger, .alert.alert-primary {
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glow);
  animation: slideInFromTop 0.8s ease-out;
}

@keyframes slideInFromTop {
  0% { transform: translate3d(0, -50px, 0); opacity: 0; }
  100% { transform: translate3d(0, 0, 0); opacity: 1; }
}

/*! Modern Main Header */
.main-header {
  height: calc(100vh - 135px);
  position: relative;
  overflow: hidden;
}

.main-header::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(204, 233, 231, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
  z-index: -1;
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -15px, 0); }
}

.main-header .text {
  width: 45%;
  animation: slideInFromLeft 1s ease-out;
  z-index: 2;
  position: relative;
  will-change: transform, opacity;
}

@keyframes slideInFromLeft {
  0% { transform: translate3d(-100px, 0, 0); opacity: 0; }
  100% { transform: translate3d(0, 0, 0); opacity: 1; }
}

 .main-header .text p:nth-child(1) {
   color: var(--primary-cyan);
   font-family: 'Barlow', sans-serif;
   font-size: 42px;
   font-style: normal;
   font-weight: 600;
   line-height: 1.1;
   text-transform: uppercase;
   background: linear-gradient(135deg, #CCE9E7 0%, #a8d5d3 100%);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
   animation: textGlow 3s ease-in-out infinite alternate;
 }

@keyframes textGlow {
  0% { filter: drop-shadow(0 0 5px rgba(204, 233, 231, 0.3)); }
  100% { filter: drop-shadow(0 0 15px rgba(204, 233, 231, 0.6)); }
}

 .main-header .text p:nth-child(2) {
   color: var(--text-secondary);
   font-family: 'Montserrat', Arial, sans-serif;
   font-style: normal;
   font-weight: 300;
   font-size: 16px;
   line-height: 1.6;
   margin: 2rem 0;
   animation: fadeInUp 1.2s ease-out 0.3s both;
 }

@keyframes fadeInUp {
  0% { transform: translate3d(0, 30px, 0); opacity: 0; }
  100% { transform: translate3d(0, 0, 0); opacity: 1; }
}

 .main-header .text button {
   border-radius: 12px;
   border: 2px solid var(--primary-cyan);
   background: linear-gradient(135deg, var(--primary-cyan) 0%, #a8d5d3 100%);
   display: flex;
   padding: 14px 24px;
   justify-content: center;
   align-items: center;
   color: #000;
   text-align: center;
   font-family: 'Inter', sans-serif;
   font-size: 14px;
   font-style: normal;
   font-weight: 600;
   line-height: normal;
   text-transform: uppercase;
   width: fit-content;
   transition: all 0.3s ease;
   position: relative;
   overflow: hidden;
   box-shadow: 0 8px 25px rgba(204, 233, 231, 0.3);
   will-change: transform, box-shadow, filter;
   backface-visibility: hidden;
 }

.main-header .text button:hover {
  transform: translate3d(0, -3px, 0);
  box-shadow: 0 15px 35px rgba(204, 233, 231, 0.4);
  filter: brightness(1.1);
}

.main-header .text button:active {
  transform: translateY(-1px);
}

.main-header .text button:nth-of-type(2) {
  background: transparent;
  color: var(--primary-cyan);
  border: 2px solid var(--primary-cyan);
  margin-left: 1rem;
}

.main-header .text button:nth-of-type(2):hover {
  background: var(--primary-cyan);
  color: #000;
}

 .secondary-button {
   border-radius: 12px;
   border: 2px solid var(--primary-cyan);
   background: transparent;
   display: flex;
   padding: 14px 24px;
   justify-content: center;
   align-items: center;
   color: var(--primary-cyan);
   text-align: center;
   font-family: 'Inter', sans-serif;
   font-size: 14px;
   font-style: normal;
   font-weight: 600;
   line-height: normal;
   text-transform: uppercase;
   width: fit-content;
   transition: all 0.3s ease;
   position: relative;
   overflow: hidden;
   box-shadow: 0 8px 25px rgba(204, 233, 231, 0.2);
 }

.secondary-button:hover {
  background: var(--primary-cyan);
  color: #000;
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(204, 233, 231, 0.4);
}

.main-header .image {
  width: 55%;
  height: 385px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url('../img/main-1.webp');
  animation: slideInFromRight 1s ease-out 0.2s both;
  filter: drop-shadow(0 20px 50px rgba(204, 233, 231, 0.3));
  display: block;
}

@keyframes slideInFromRight {
  0% { transform: translate3d(100px, 0, 0); opacity: 0; }
  100% { transform: translate3d(0, 0, 0); opacity: 1; }
}



.main-buttons {
  margin-right: 4px;
}

/*! Modern Section Titles */
 .section-title {
   text-align: center;
   color: var(--primary-cyan);
   font-family: 'Barlow', sans-serif;
   font-size: 36px;
   font-style: normal;
   font-weight: 700;
   line-height: normal;
   text-transform: uppercase;
   margin-top: 8rem;
   margin-bottom: 2rem;
   background: linear-gradient(135deg, #CCE9E7 0%, #a8d5d3 100%);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
   position: relative;
   z-index: 2; /* ensure it sits above following sections */
   padding-bottom: 0.75rem; /* reserve space for the line so it never gets overlapped */
   animation: fadeInUp 0.8s ease-out;
 }

.section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0; /* anchor exactly at the bottom edge we reserved */
  width: 120px; /* a bit wider for better visibility */
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary-cyan), transparent);
  border-radius: 2px;
  z-index: 1;
}

 .sub-title {
   text-align: center;
   color: var(--text-secondary);
   font-family: 'Montserrat', Arial, sans-serif;
   font-size: 16px;
   font-style: normal;
   font-weight: 300;
   line-height: normal;
   margin-bottom: 3rem;
   animation: fadeInUp 0.8s ease-out 0.2s both;
 }

/*! Modern Feature Sections */
.feature-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-top: 8rem !important;
  backdrop-filter: blur(5px);
  background: var(--glass-bg);
  border-radius: 25px;
  padding: 3rem;
  border: 1px solid var(--border-glow);
  box-shadow: var(--shadow-glow);
  transition: all 0.5s ease;
  animation: fadeInUp 0.8s ease-out;
}

.feature-section:hover {
  transform: translate3d(0, -10px, 0);
  box-shadow: 0 25px 50px rgba(204, 233, 231, 0.15);
  border-color: rgba(204, 233, 231, 0.5);
}

.feature-section .feature-detail {
  background-size: 100% 100%;
  background-repeat: no-repeat;
  width: 50%;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

 .feature-section .feature-detail p:nth-child(1) {
   font-size: 32px;
   font-family: 'Barlow', sans-serif;
   font-style: normal;
   font-weight: 400;
   line-height: 1.1;
   display: flex;
   align-items: center;
   text-transform: uppercase;
   color: var(--primary-cyan);
   background: linear-gradient(135deg, #CCE9E7 0%, #a8d5d3 100%);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
   margin-bottom: 0.5rem;
 }

 .feature-section .feature-detail p:nth-child(2) {
   color: var(--primary-cyan);
   font-family: 'Barlow', sans-serif;
   font-size: 26px;
   font-style: normal;
   font-weight: 700;
   line-height: normal;
   display: flex;
   align-items: center;
   margin-bottom: 1.5rem;
 }

 .feature-section .feature-detail p:nth-child(3) {
   color: var(--text-secondary);
   font-family: 'Montserrat', Arial, sans-serif;
   font-size: 16px;
   font-style: normal;
   font-weight: 300;
   line-height: 1.6;
   margin-bottom: 2rem;
 }

.feature-section img {
  max-height: 350px;
  padding: 2rem;
  max-width: 100%;
  transition: all 0.3s ease;
  filter: drop-shadow(0 15px 40px rgba(204, 233, 231, 0.4)) brightness(1.1);
}

.feature-section img:hover {
  transform: scale(1.05) rotate(2deg);
}

/*! Tilt effects for special elements */
.main-header .image:hover {
  transform: scale(1.05);
}

/*! Removed background glow on feature section hover */

 .feature-section .feature-detail button {
   border-radius: 12px;
   border: 2px solid var(--primary-cyan);
   background: linear-gradient(135deg, var(--primary-cyan) 0%, #a8d5d3 100%);
   display: flex;
   padding: 12px 20px;
   justify-content: center;
   align-items: center;
   color: #000;
   text-align: center;
   font-family: 'Inter', sans-serif;
   font-size: 14px;
   font-style: normal;
   font-weight: 600;
   line-height: normal;
   text-transform: uppercase;
   width: fit-content;
   transition: all 0.3s ease;
   box-shadow: 0 8px 25px rgba(204, 233, 231, 0.3);
 }

.feature-section .feature-detail button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(204, 233, 231, 0.4);
  filter: brightness(1.1);
}

/*! Chart Section */
.chart {
  margin-top: 10rem;
  text-align: center;
  padding: 4rem 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  border: 1px solid var(--border-glow);
  box-shadow: var(--shadow-glow);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/*! Chart behaves like other static sections */

 .chart p:nth-child(1) {
   color: var(--primary-cyan);
   font-family: 'Barlow', sans-serif;
   font-size: 36px;
   font-style: normal;
   font-weight: 700;
   line-height: normal;
   text-align: center;
   text-transform: uppercase;
   background: linear-gradient(135deg, #CCE9E7 0%, #a8d5d3 100%);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
   margin-bottom: 1.5rem;
 }

 .chart p:nth-child(2) {
   color: var(--text-secondary);
   font-family: 'Montserrat', Arial, sans-serif;
   font-size: 16px;
   font-style: normal;
   font-weight: 300;
   line-height: 1.6;
   text-align: center;
   max-width: 800px;
   margin: 0 auto 3rem;
 }

.diagram {
  height: 100%;
  margin-top: 3rem;
  text-align: center;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  clear: both;
  padding: 2rem 2rem 5rem 2rem;
}

.diagram:hover {
  transform: rotate(1deg);
}

.diagram img {
  max-width: min(90%, 800px);
  height: auto;
  border-radius: 15px;
  box-shadow: 0 25px 60px rgba(204, 233, 231, 0.2);
  transition: all 0.3s ease;
}

.diagram img:hover {
  transform: scale(1.02) rotate(1deg);
}

/*! Modern Tabs */
.tab-button.active {
  opacity: 1;
  background: linear-gradient(135deg, var(--primary-cyan) 0%, #a8d5d3 100%) !important;
  color: #000 !important;
  border: none;
  border-radius: 12px;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(204, 233, 231, 0.3);
}

.tab-button.active:hover {
  opacity: 1;
  background: linear-gradient(135deg, var(--primary-cyan) 0%, #a8d5d3 100%) !important;
  color: #000 !important;
  border: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(204, 233, 231, 0.3);
}

.tab-button:not(.active):hover {
  border: none;
  color: var(--primary-cyan) !important;
  opacity: 1;
  transform: translateY(-2px);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(204, 233, 231, 0.2);
}

 .tab-button {
   opacity: 0.6;
   background: transparent;
   color: var(--text-secondary);
   text-align: center;
   font-family: 'Barlow', sans-serif;
   font-size: 22px;
   font-style: normal;
   font-weight: 400;
   line-height: normal;
   text-transform: uppercase;
   padding: 1rem 2rem;
   margin: 0 0.5rem;
   border-radius: 12px;
   transition: all 0.3s ease;
   border: 1px solid transparent;
 }

.tab-pane {
  padding: 2rem 1rem;
  gap: 2rem;
  flex-wrap: wrap;
}

.tab-content > .active {
  display: flex !important;
  animation: fadeInUp 0.6s ease-out;
}

.tab-card {
  border-radius: 20px;
  border: 1px solid var(--border-glow);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  display: flex;
  min-width: 300px;
  padding: 2.5rem;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.tab-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-cyan), #a8d5d3);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tab-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 25px 50px rgba(204, 233, 231, 0.15);
  border-color: rgba(204, 233, 231, 0.5);
}

.tab-card:hover::before {
  opacity: 1;
}

.tab-image {
  width: 110px;
  height: 125px;
  transition: all 0.3s ease;
  filter: drop-shadow(0 8px 20px rgba(204, 233, 231, 0.3)) brightness(1.05);
}

.tab-card:hover .tab-image {
  transform: scale(1.1) rotate(3deg);
}

.tab-card p {
  text-align: center;
}

.tab-card p:nth-child(1) {
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

 .tab-card p:nth-child(2) {
   color: var(--primary-cyan);
   font-family: 'Barlow', sans-serif;
   font-size: 24px;
   font-style: normal;
   font-weight: 600;
   line-height: normal;
   text-transform: uppercase;
   background: linear-gradient(135deg, #CCE9E7 0%, #a8d5d3 100%);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
 }

 .tab-card p:nth-child(3) {
   color: var(--primary-cyan);
   font-family: 'Barlow', sans-serif;
   font-size: 16px;
   font-style: normal;
   font-weight: 700;
   line-height: normal;
 }

 .tab-card p:nth-child(4) {
   color: var(--text-secondary);
   font-family: 'Inter', sans-serif;
   font-size: 14px;
   font-style: normal;
   font-weight: 400;
   line-height: 1.6;
 }

/*! Modern Footer */
footer {
  margin-top: 8rem !important;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  border: 1px solid var(--border-glow);
  padding: 3rem 2rem 2rem;
  box-shadow: var(--shadow-glow);
}

footer .logo {
  font-style: normal;
  font-weight: 400;
  font-size: 35px;
  line-height: 45px;
  color: var(--primary-cyan);
}

 footer .nav-link {
   font-family: 'Inter', sans-serif;
   font-style: normal;
   font-weight: 500;
   font-size: 14px;
   line-height: 28px;
   color: var(--text-secondary);
   transition: all 0.3s ease;
   padding: 0.5rem 0;
   padding-left: 0;
   border-radius: 8px;
 }

footer .nav-link:focus,
footer .nav-link:hover {
  color: var(--primary-cyan);
  transform: translateX(5px);
  background: var(--glass-bg);
  padding-left: 1rem;
}

footer .list-group-item {
  background: transparent;
  border: none;
  padding: 0;
  margin-left: 0;
}

 footer .link-header {
   padding: 1rem 0;
   margin-left: 0;
   font-family: 'Barlow', sans-serif;
   font-style: normal;
   font-weight: 600;
   font-size: 16px;
   line-height: 28px;
   text-transform: uppercase;
   color: var(--primary-cyan);
   border-bottom: 2px solid rgba(204, 233, 231, 0.3);
   background: linear-gradient(135deg, #CCE9E7 0%, #a8d5d3 100%);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
 }

 .copyright {
   font-family: 'Inter', sans-serif;
   font-style: normal;
   font-weight: 400;
   font-size: 12px;
   line-height: 22px;
   text-align: center;
   letter-spacing: 0.1em;
   text-transform: uppercase;
   color: rgba(204, 233, 231, 0.4);
   padding: 2rem 0 1rem;
   border-top: 1px solid rgba(204, 233, 231, 0.1);
   margin-top: 2rem;
   margin-bottom: 0;
 }

/*! Enhanced Responsive Design */
@media (max-width: 991px) {
  .main-header {
    flex-direction: column;
    height: auto !important;
    text-align: center;
    padding: 2rem 0;
  }

  .main-header .image,
  .main-header .text {
    width: 100% !important;
  }

  .main-header .text {
    align-items: center;
    justify-content: center;
    margin-bottom: 3rem;
  }

  .main-header .image {
    min-height: 300px !important;
    background-size: contain !important;
  }

  .feature-section {
    flex-wrap: wrap;
    justify-content: center !important;
    gap: 3rem;
    padding: 2rem;
  }

  .feature-section .feature-detail {
    width: 100% !important;
    text-align: center;
  }

  .section-title {
    font-size: 36px;
  }

  .navbar {
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
  }

  .social-link-container {
    position: relative;
    align-self: center;
  }
}

@media (max-width: 778px) {
  .tab-card {
    padding: 1.5rem !important;
    gap: 1rem !important;
  }

  .tab-card p:nth-child(2) {
    font-size: 24px !important;
  }

  .tab-button {
    font-size: 20px;
    padding: 0.8rem 1.5rem;
  }
}

@media (max-width: 768px) {
  footer {
    flex-wrap: wrap;
    text-align: center;
    padding: 2rem 1rem;
  }

  footer > * {
    width: 100%;
    margin-bottom: 2rem;
  }

  .main-header .text p:nth-child(1) {
    font-size: 40px;
  }

  /* Fix paragraph text alignment on mobile */
  .main-header .text p:nth-child(2) {
    text-align: left;
  }

  .feature-section .feature-detail p:nth-child(2) {
    display: block !important;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    line-height: 1.3;
    text-align: left;
  }

  .feature-section .feature-detail p:nth-child(3) {
    text-align: left;
  }

  .tab-card p:nth-child(4) {
    text-align: left;
  }
}

@media (max-width: 570px) {
  .main-header .text p:nth-child(1) {
    font-size: 32px !important;
  }

  .section-title {
    font-size: 28px;
  }

  .feature-section {
    margin-top: 4rem !important;
    padding: 1.5rem;
  }

  .feature-section .feature-detail p:nth-child(1) {
    font-size: 32px;
  }

  .feature-section .feature-detail p:nth-child(2) {
    font-size: 24px;
    display: block !important;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    line-height: 1.3;
    text-align: left;
  }

  footer.justify-content-between {
    flex-wrap: wrap;
    justify-content: center !important;
  }

  footer.justify-content-between > * {
    display: flex;
    width: 100%;
    text-align: center;
    align-items: center;
    justify-content: center;
  }

  /* Additional text alignment fixes for smallest screens */
  .main-header .text p:nth-child(2) {
    text-align: left;
    line-height: 1.6;
  }

  .tab-card {
    text-align: left;
  }

  .tab-card p:nth-child(1),
  .tab-card p:nth-child(2),
  .tab-card p:nth-child(3) {
    text-align: center;
  }

  .tab-card p:nth-child(4) {
    text-align: left;
    margin-top: 1rem;
  }
}

/*! Additional animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/*! Optimized scroll animations */
.scroll-animation {
  opacity: 0;
  transform: translate3d(0, 20px, 0) scale(0.95);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform, opacity;
  contain: layout style paint;
}

.scroll-animation.animate {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Auto-clear will-change after animation */
.scroll-animation.animate:not(:hover) {
  will-change: auto;
}

/*! Staggered animation delays for smoother effect */
.scroll-animation:nth-child(1) { transition-delay: 0ms; }
.scroll-animation:nth-child(2) { transition-delay: 100ms; }
.scroll-animation:nth-child(3) { transition-delay: 200ms; }
.scroll-animation:nth-child(4) { transition-delay: 300ms; }
.scroll-animation:nth-child(5) { transition-delay: 400ms; }

/*! Loading animation */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(204, 233, 231, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-cyan);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/*! Performance Optimizations */
/* Respect user's motion preferences */
@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;
  }
  
  .scroll-animation {
    animation: none;
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* GPU layer optimization for frequently animated elements */
.main-header .text button,
.feature-section,
.tab-card,
.social-links,
.diagram img {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Clear will-change after animations complete */
.feature-section:not(:hover),
.tab-card:not(:hover),
.main-header .text button:not(:hover) {
  will-change: auto;
}

/* Optimize for touch devices */
@media (hover: none) and (pointer: coarse) {
  .feature-section:hover,
  .tab-card:hover,
  .diagram:hover,
  .main-header .image:hover {
    transform: none;
  }
}