:root {
    --primary-green: #01733b;
    --dark-green: #02723a;
    --text-dark: #000000;
    --text-gray: #545454;
    --text-light-gray: #919191;
    --bg-light: #ffffff;
    --bg-blue: #e7f5fe;
    --border-gray: #bdbdbd;
    --progress-bg: #d9d9d9;
    --max-width: 1512px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 90%;
    height: auto;
    display: block;
}

/* CSS for section section:Intro */
#section-intro {
    padding: 80px 0 40px;
}

.container {
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.intro-container {
    max-width: 1200px;
}

.intro-title {
    color: var(--primary-green);
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.6;
}

.intro-subtitle {
    color: var(--text-gray);
    font-size: 24px;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 20px;
    line-height: 1.6;
}

.intro-text {
    font-size: 18px;
    color: var(--text-dark);
    line-height: 1.6;
}

@media (max-width: 768px) {
    #section-intro {
        padding: 50px 0 30px;
    }

    .intro-title {
        font-size: 36px;
    }

    .intro-subtitle {
        font-size: 20px;
    }
}

/* CSS for section section:Features */
#section-features {
    padding: 40px 0 80px;
    overflow: hidden;
}

.feature-row {
    display: flex;
    align-items: center;
    margin-bottom: 80px;
    position: relative;
}

.feature-row.reverse {
    flex-direction: row-reverse;
}

.feature-card {
    background-color: var(--bg-light);
    border: 1px solid var(--border-gray);
    border-radius: 50px;
    padding: 60px 50px;
    width: 48%;
    position: relative;
    z-index: 2;
    box-shadow: 0px 4px 4px #d9d9d9; /* solid, no blur */
}

.feature-row:not(.reverse) .feature-card {
    margin-right: -10%;
}

.feature-row.reverse .feature-card {
    margin-left: -10%;
}

.feature-title {
    font-size: 36px;
    font-weight: 200;
    color: var(--text-gray);
    margin-bottom: 25px;
    line-height: 1.2;
}

.feature-desc {
    font-size: 16px;
    color: var(--text-dark);
    line-height: 1.6;
}

.feature-image-wrapper {
    width: 63%;
    position: relative;
    z-index: 1;
}

.feature-image {
    width: 100%;
    height: auto;
    border-radius: 20px;
    object-fit: cover;
}

@media (max-width: 1024px) {
    .feature-card {
        padding: 40px 30px;
        width: 50%;
    }

    .feature-title {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .feature-row,
    .feature-row.reverse {
        flex-direction: column;
        margin-bottom: 50px;
    }

    .feature-card {
        width: 90%;
        margin: 0 auto -40px auto !important;
        padding: 30px 20px;
        border-radius: 30px;
        text-align: center;
    }

    .feature-image-wrapper {
        width: 100%;
    }

    .feature-title {
        font-size: 24px;
    }
}

/* CSS for section section:Milestones */
#section-milestones {
    padding: 60px 0 100px;
    overflow-x: hidden;
    overflow-x: clip;
}

.milestones-header {
    max-width: 1200px;
    margin-bottom: 60px;
}

.milestones-title {
    color: var(--primary-green);
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 20px;
}

.milestones-desc {
    font-size: 18px;
    color: var(--text-dark);
}

.timeline-section {
    margin-bottom: 100px;
}

.timeline-category {
    color: var(--text-light-gray);
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 40px;
}

.timeline-layout {
    display: flex;
    gap: 60px;
    align-items: stretch;
}

.timeline-layout.reverse {
    /* In Figma, the second timeline has text on left, image on right */
    /* But the structure is slightly different, let's just use flex order or structure it directly */
}

.timeline-image-col {
    flex: 0 0 40%;
}

.timeline-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #d9d9d9;
    /* placeholder bg */
}

.timeline-content-col {
    flex: 1;
    display: flex;
    position: relative;
    padding: 20px 0;
}

.timeline-graphics {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 40px;
    position: relative;
    width: 40px;
}

.tl-arrow {
    width: 35px;
    height: auto;
}

.tl-line {
    flex: 1;
    width: 2px;
    background-color: var(--text-dark);
    margin: 5px 0;
}

.timeline-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* justify-content: space-between;  <-- Remove or comment this out */
    padding: 30px 20px; /* Added horizontal padding for scrollbar breathing room */

    /* --- NEW SCROLL LOGIC --- */
    max-height: 500px; /* Adjust this height to fit your design */
    overflow-y: auto; /* Enables vertical scrolling */
    overflow-x: hidden; /* Prevents horizontal shaking */
}

/* Custom Scrollbar for Chrome/Safari/Edge */
.timeline-items::-webkit-scrollbar {
    width: 6px;
}

.timeline-items::-webkit-scrollbar-track {
    background: var(--progress-bg);
    border-radius: 10px;
}

.timeline-items::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 10px;
}

.tl-item {
    position: relative;
    margin-bottom: 40px;
}

.tl-item:last-child {
    margin-bottom: 0;
}

.tl-dot {
    position: absolute;
    left: -67px;
    /* Align with the line */
    top: 8px;
    width: 15px;
    height: 15px;
    background-color: var(--bg-light);
    border-radius: 50%;
}

.tl-year {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.tl-text {
    font-size: 16px;
    color: var(--text-dark);
    max-width: 90%;
}

.tl-list {
    list-style: disc inside;
    margin: 10px 0 0;
    padding-left: 24px;
    color: var(--text-dark);
    font-size: 16px;
    line-height: 1.6;
}

.tl-list li {
    margin-bottom: 8px;
}

.tl-list li:last-child {
    margin-bottom: 0;
}

.progress-fill {
    position: absolute;
    top: 0;
    width: 100%;
    background-color: var(--primary-green);
}

@media (max-width: 992px) {
    .timeline-layout,
    .timeline-layout.reverse {
        flex-direction: column;
    }

    .timeline-image-col {
        height: 300px;
    }

    .timeline-progress {
        display: none;
        /* Hide decorative progress bar on smaller screens for simplicity */
    }
}

@media (max-width: 768px) {
    /* 1. Global Section Spacing Compression */
    #section-intro {
        padding: 30px 0px 15px !important; /* Kept tight to the top header */
    }

    #section-features {
        padding: 15px 0px 30px !important; /* Drastically reduced vertical gap */
    }

    #section-milestones {
        padding: 30px 0px 40px !important; /* Dropped from 60px/100px */
    }

    /* 2. Intro Section Adjustments */
    .intro-title {
        margin-bottom: 6px;
    }

    .intro-subtitle {
        margin-bottom: 12px;
    }

    /* 3. Features Row Spacing */
    .feature-row {
        margin-bottom: 30px !important; /* Halved spacing between stacked rows */
    }

    .feature-card {
        margin: 0 auto -20px auto !important; /* Shrunk negative pull overlap from -40px */
        padding: 24px 16px !important; /* Compact interior card padding */
    }

    .feature-title {
        margin-bottom: 12px !important;
    }

    /* 4. Milestones & Timeline Spacing */
    .milestones-header {
        margin-bottom: 25px !important; /* Snaps title closer to timeline blocks */
    }

    .milestones-title {
        margin-bottom: 10px !important;
    }

    .timeline-section {
        margin-bottom: 40px !important; /* Shrunk massive 100px layout gap */
    }

    .timeline-category {
        margin-bottom: 15px !important; /* Pulls category labels closer to the grid */
    }

    .timeline-layout {
        gap: 20px !important; /* Clean stacking gap for image and text blocks */
    }

    .timeline-image-col {
        height: 220px !important; /* Shrunk image height to fit screen gracefully */
    }

    .timeline-content-col {
        padding: 5px 0 !important;
    }

    /* 5. Fixing Layout Breaking Graphics on Mobile */
    .timeline-graphics {
        display: none !important; /* Hides layout-breaking arrows and lines on mobile */
    }

    .timeline-items {
        padding: 10px 5px !important;
        max-height: 400px !important; /* Slightly more compact scroll area */
    }

    .tl-item {
        margin-bottom: 25px !important; /* Pulls timeline items closer together */
    }

    .tl-dot {
        display: none !important; /* Removes absolute dots that now misalign */
    }

    .tl-text {
        max-width: 100% !important; /* Lets content fill mobile width naturally */
    }
}

@media (max-width: 992px) {
    /* Target the container to ensure it's flowing as a column stack */
    .timeline-layout,
    .timeline-layout.reverse {
        display: flex;
        flex-direction: column !important;
    }

    /* Force the image container column to the absolute top of the stack */
    .timeline-image-col {
        order: -1 !important;
        margin-bottom: 20px; /* Adds clean spacing below the image before text starts */
    }

    /* Ensure the text items column flows naturally underneath the image */
    .timeline-content-col {
        order: 1 !important;
    }
}

@media (max-width: 768px) {
    .feature-row,
    .feature-row.reverse {
        display: flex;
        flex-direction: column !important;
        align-items: center !important; /* Centers both card and image horizontally */
        margin-bottom: 40px !important; /* Spacing between each distinct feature block */
    }

    .feature-card {
        width: 90% !important;
        /* Adjust the -15px value below to control the overlap amount. 
           Closer to 0px = less overlap / separate items. 
           More negative (e.g. -30px) = deeper overlap. */
        margin: 0 auto -15px auto !important;
        padding: 24px 20px !important;
        position: relative;
        z-index: 3 !important; /* Ensures the text card floats firmly above the image */
        text-align: center;
    }

    .feature-image-wrapper {
        width: 100% !important;
        display: flex;
        justify-content: center;
        position: relative;
        z-index: 1 !important;
    }

    .feature-image {
        width: 90% !important; /* Pulling the width in slightly keeps it balanced behind centered text */
        margin: 0 auto !important;
        display: block;
    }
}
