/* ===== Global Styles & Base Setup ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--background-dark);
    font-family: var(--primary-font);
    color: var(--text-color-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    max-width: 100vw;
}

/* ===== Container & Layout ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    overflow: hidden;
}

/* ===== Media & Image Fixes ===== */
img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

/* ===== Accessibility: Focus States ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.carousel__dots button:focus-visible,
.carousel__arrow:focus-visible,
[tabindex="0"]:focus-visible {
    outline: var(--focus-visible-outline-width) solid var(--focus-outline-color);
    outline-offset: var(--focus-visible-outline-offset);
    box-shadow: 0 0 0 4px var(--focus-visible-ring-color);
}

a:focus,
button:focus,
.carousel__dots button:focus,
.carousel__arrow:focus,
[tabindex="0"]:focus {
    outline: none;
}

/* ===== Skip Link for Accessibility ===== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--accent-color);
    color: var(--cta-text-color);
    padding: 10px 15px;
    z-index: 9999;
    text-decoration: none;
    font-weight: 600;
    border-bottom-right-radius: 5px;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--background-dark);
}

/* ===== Home Hero Section ===== */
.home-section {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0;
}

.home-section__carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.carousel__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
}

.carousel__slide--active {
    opacity: 1;
    visibility: visible;
}

.carousel__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    transition: transform 0.6s ease-in-out;
    /* Prevent layout shift */
    aspect-ratio: 16/9;
}

.carousel__slide--active .carousel__image {
    transform: scale(1);
}

/* ===== Individual Slide Content ===== */
.slide-content {
    position: absolute;
    left: 0;
    bottom: 50px;
    width: 100%;
    text-align: left;
    padding: 0 5% 80px;
    z-index: 25;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-in-out 0.2s, transform 0.8s ease-in-out 0.2s;
}

.carousel__slide--active .slide-content {
    opacity: 1;
    transform: translateY(0);
}

.slide-content__title {
    font-size: 40px;
    font-weight: bolder;
    letter-spacing: -0.5px;
    line-height: 1.2;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9); /* Improved contrast */
}

.slide-content__description {
    font-size: 20px;
    text-align: left;
    font-weight: 450;
    color: var(--text-color-light);
    line-height: 1.6;
    max-width: 650px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9); /* Improved contrast */
}

.home-section__controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 30;
}

/* ===== Carousel Dots with Transparent Fill Animation ===== */
.carousel__dots {
    position: absolute;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    justify-content: center;
}

.carousel__dots button,
.carousel__dot {
    width: 40px;
    height: 12px;
    background: transparent;
    border: 3px solid #fff;
    border-radius: 8px;
    opacity: 0.7;
    cursor: pointer;
    padding: 0;
    position: relative;
    overflow: hidden;
}

/* Invisible larger touch target using pseudo-element */
.carousel__dots button::before,
.carousel__dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 44px;
    z-index: 1;
}

.carousel__dots button:hover:not(.active),
.carousel__dot:hover:not(.active) {
    opacity: 0.9;
}

.carousel__dots button.active,
.carousel__dot.active {
    opacity: 1;
}

.carousel__dots button .progress,
.carousel__dot .progress {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    transform: scaleX(0);
    transform-origin: left;
    transition: none;
    z-index: 0;
}

.carousel__dots button.active .progress.filling,
.carousel__dot.active .progress.filling {
    transform: scaleX(1);
    /* Transition duration is set dynamically by JavaScript */
}

.carousel__arrows {
    position: absolute;
    top: -50vh;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 15px;
    z-index: 35;
    pointer-events: none;
}

.carousel__arrow {
    background-color: rgba(0, 0, 0, 0.3);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    opacity: 0.7;
}

.carousel__arrow:hover,
.carousel__arrow:focus-visible {
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 1;
}

.carousel__slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0, 13, 0, 0.8) 0%, rgba(0, 13, 0, 0.6) 8%, rgba(0, 10, 0, 0.3) 15%, rgba(0, 10, 0, 0.1) 25%, rgba(0, 0, 0, 0.02) 40%, rgba(0, 0, 0, 0) 60%);
    z-index: 10;
    pointer-events: none;
}

.home-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: linear-gradient(to bottom, rgba(0, 13, 0, 0) 0%, rgba(0, 13, 0, 0.3) 50%, var(--background-section) 100%);
    z-index: 20;
}

/* ===== Responsive Hero Styles ===== */
@media (max-width: 768px) {
    .slide-content {
        padding: 0 20px 60px;
        bottom: 90px;
        gap: 10px;
    }

    .slide-content__title {
        font-size: clamp(24px, 7vw, 32px);
        line-height: 1.2;
        margin-bottom: 5px;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
    }

    .slide-content__description {
        font-size: clamp(14px, 4vw, 16px);
        max-width: 100%;
        line-height: 1.4;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9); /* Stronger shadow for readability */
    }

    /* Adjust image position to show faces/top part better on mobile portrait */
    .carousel__image {
        object-position: center 20%;
    }

    /* Hide carousel dots on mobile */
    .carousel__dots {
        display: none;
    }

    .carousel__arrow {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .carousel__arrows {
        padding: 0 5px;
    }
}



/* ===== Menu Toggle Animation ===== */
.navbar__toggle.active .navbar__toggle-bar:nth-child(1) {
    transform: translateY(6px) rotate(-45deg);
}

.navbar__toggle.active .navbar__toggle-bar:nth-child(2) {
    opacity: 0;
}

.navbar__toggle.active .navbar__toggle-bar:nth-child(3) {
    transform: translateY(-6px) rotate(45deg);
}

/* ===== Accessibility: Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .carousel__slide,
    .carousel__image,
    .slide-content,
    .partners__track {
        animation: none !important;
        transition: none !important;
    }
}