/* Hero Section */
#hero {
    background: linear-gradient(180deg, var(--color-background) 0%, #111 100%);
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 20px;
    position: relative;
    text-align: center;
    overflow: hidden;
}

#hero h2 {
    font-size: 4rem;
    margin-bottom: 30px;
    line-height: 1.2;
    max-width: 1000px;
    background: linear-gradient(180deg, var(--color-text-primary) 40%, var(--color-background) 120%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    color: var(--color-text-primary); /* Fallback */
    position: relative;
    z-index: 2;
}

#hero p {
    font-size: 1.5rem;
    color: var(--color-text-secondary);
    margin-bottom: 40px;
    max-width: 700px;
    font-weight: 400;
    position: relative;
    z-index: 2;
}

#hero .join-now-button {
    position: relative;
    z-index: 2;
}

#switch-word {
    color: var(--color-accent-secondary);
    font-weight: 800;
    position: relative;
    display: inline-block;
    -webkit-text-fill-color: initial;
}

#switch-word::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--color-accent-secondary);
    opacity: 0.5;
}

/* Background Elements Common Styles */
.hero-bg,
.features-bg,
.impact-bg,
.footer-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.bg-element-2,
.bg-element-3,
.bg-element-5,
.bg-element-10,
.bg-element-11 {
    position: absolute;
    opacity: 0.6; /* Slightly reduce opacity to blend better */
}

/* Specific Background Positioning with Responsive Units */
.hero-bg .bg-element-2 {
  top: 20%;
  right: -5%; /* Align to right instead of fixed left pixel */
  left: auto;
  filter: blur(130px); /* Reduced blur slightly for performance/visibility */
  width: 40%;
  max-width: 500px;
}

/* Features Section */
.features-section {
    padding: 100px 5%;
    /* Smooth transition from Hero's #111 end color */
    background: linear-gradient(180deg, #111 0%, var(--color-background) 100%);
    position: relative;
    overflow: hidden;
}

.features-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.features-bg .bg-element-5 {
  bottom: 10%; /* Position from bottom */
  right: 0;    /* Position from right */
  left: auto;
  top: auto;
  filter: blur(100px);
  transform: rotate(10.29deg);
  width: 35%;
  max-width: 450px;
}

.feature-card {
    flex: 1 1 280px;
    max-width: 400px;
    background: rgba(17, 17, 17, 0.8); /* Slight transparency */
    padding: 40px;
    border-radius: 20px;
    border: 2px solid transparent;
    position: relative;
    transition: transform 0.3s ease;
    text-align: left;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px); /* Frosted glass effect over background elements */
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, #2ae4cf 0%, #25a4ff 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    transition: background 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card:hover::before {
    background: linear-gradient(135deg, #00d4ff 0%, #00ffd4 100%);
}

.feature-card h3 {
    background: linear-gradient(135deg, #2fd1c5 0%,  #04b1c5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.feature-card p {
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.feature-icon {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #2ae4cf  0%, #25afff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    display: block;
}

/* Stats Section */
.stats-section {
    padding: 80px 20px;
    background: var(--color-background); /* Match end of Features section */
    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
    position: relative;
    overflow: hidden;
}

.stats-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 60px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.impact-bg .bg-element-3 {
  top: -20%;
  left: -10%;
  filter: blur(100px);
  transform: rotate(10.29deg);
  width: 50%;
  max-width: 600px;
}

.stat-item {
    text-align: center;
    position: relative;
    z-index: 2;
}

.stat-item h3 {
    font-size: 3.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1;
    font-weight: 800;
}

.stat-item p {
    color: var(--color-text-secondary);
    margin-top: 10px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* CTA Section */
.cta-section {
    padding: 120px 20px;
    background: linear-gradient(180deg, var(--color-background) 0%, #111 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section h2 {
    margin-bottom: 30px;
    font-size: 3rem;
    background: linear-gradient(90deg, #8e23e2, #cf2576);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    z-index: 2;
}

.cta-section p, .cta-section button {
    position: relative;
    z-index: 2;
}

.gradient-text {
    background: linear-gradient(90deg, #8e23e2, #cf2576);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #cf2576;
}

/* Footer */
footer {
    position: relative;
    overflow: hidden;
    background: #111; /* Continued from CTA */
}

.footer-bg img {
  position: absolute;
  filter: blur(100px);
  opacity: 0.5;
}

.footer-bg .bg-element-10 {
  top: 10%;
  left: -10%;
  transform: rotate(41.31deg);
  width: 40%;
  max-width: 500px;
}

.footer-bg .bg-element-11 {
  bottom: -20%;
  right: -5%;
  left: auto;
  top: auto;
  transform: rotate(10.29deg);
  width: 40%;
  max-width: 500px;
}

footer p, footer .social-icon {
    position: relative;
    z-index: 2;
}

/* Animation Keyframes */
@keyframes switchWordAnimation {
    0% { transform: rotateX(0); opacity: 1; }
    50% { transform: rotateX(90deg); opacity: 0; }
    100% { transform: rotateX(0); opacity: 1; }
}
.animate {
    animation: switchWordAnimation 0.5s ease;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #hero h2 {
        font-size: 2.5rem;
    }
    #hero p {
        font-size: 1.1rem;
    }
    
    /* Adjust background elements for mobile so they don't overwhelm */
    .hero-bg .bg-element-2 {
        width: 60%;
        right: -20%;
        top: 10%;
    }
    .impact-bg .bg-element-3 {
        opacity: 0.3;
    }

    .stats-grid {
        gap: 40px;
    }
    .stat-item h3 {
        font-size: 2.5rem;
    }
}
