/* css/legacy.css */
.legacy-main {
    background: #080808;
    color: #fff;
    overflow-x: hidden;
    font-family: inherit;
}

.legacy-timeline-section {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #080808;
    overflow: hidden;
}

.legacy-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Central Text */
.center-content {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    max-width: 900px;
    z-index: 10;
}

.giant-year {
    font-size: 23vw;
    font-weight: 300;
    line-height: 1;
    margin: 0 0 0 0;
    color: #fff;
    letter-spacing: -2px;
}

.desc-text {
    font-size: 16px;
    line-height: 1.6;
    color: #aaa;
    max-width: 500px;
    margin: 0 auto;
    font-weight: 400;
}

/* Horizontal HUD Bottom */
.bottom-hud {
    position: absolute;
    bottom: 5vh;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 50;
    display: flex;
    align-items: center;
}

.hud-markers {
    position: absolute;
    top: 0;
    left: 5vw;
    width: 90vw;
    height: 100%;
}

.hud-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 1;
}

.hud-progress-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 0%;
    height: 1px;
    background: #fff;
    /* Fills sequentially */
    transition: width 0.1s;
    z-index: 2;
}

.hud-marker {
    position: absolute;
    top: 0;
    /* margin-left negative half of width to perfectly center the dot over the percentage left coordinate */
    width: 160px;
    margin-left: -80px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.hud-period {
    position: absolute;
    top: 5px;
    font-size: 12px;
    color: #D5D1cc;
    transition: color 0.3s;
    letter-spacing: 0.5px;
}

.hud-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #555;
    border-radius: 50%;
    transition: background 0.3s, transform 0.3s;
}

.hud-era {
    position: absolute;
    top: 40px;
    font-size: 15px;
    color: #D5D1cc;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s;
    text-align: center;
    width: 180px;
}

/* Active HUD States */
.hud-marker.active .hud-period {
    color: #fff;
    font-weight: bold;
}

.hud-marker.active .hud-dot {
    background: #fff;
    transform: translate(-50%, -50%) scale(2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 1);
}

.hud-marker.active .hud-era {
    opacity: 1;
}

/* Floating Images - Layered behind Suffix but above Prefix */
.floating-images {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.float-item {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -20vh;
    margin-left: -12vw;
    width: 28vw;
    height: 45vh;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    opacity: 0;
    border-radius: 0;
    overflow: hidden;
    /* border: 16px solid #717171; */
}

.float-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* filter: grayscale(100%) contrast(1.1); */
}

.hud-markers .hud-marker:last-child .hud-era {
    right: 30px;
    max-width: 150px;
}

/* --- INDEPENDENT DIGIT SLIDERS --- */
.giant-year {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    /* No z-index here to avoid creating a trapped context */
}

.digit-container {
    display: inline-block;
    height: 1.1em;
    overflow: hidden;
    position: relative;
    width: 0.65em;
    text-align: center;
}

/* Layering is now handled by DOM Order in JS:
   [Digit 0][Digit 1] -> [Images] -> [Digit 2][Digit 3]
   To make this work, images must be absolute so they don't break flex spacing
*/
.floating-images {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 5;
    /* This will be relative to other siblings in giant-year */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure digits follow the sandwich order */
.digit-idx-0,
.digit-idx-1 {
    z-index: 1;
}

.digit-idx-2,
.digit-idx-3 {
    z-index: 10;
}

.center-content {
    position: absolute;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    max-width: 900px;
    z-index: 2;
}

.digit-slider {
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.digit-item {
    height: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- MOBILE OPTIMIZATIONS --- */
@media (max-width: 768px) {
    .giant-year {
        font-size: 38vw;
        /* Larger for mobile impact */
        margin-bottom: 10px;
    }

    .desc-text {
        font-size: 16px;
        padding: 0 20px;
        max-width: 100%;
    }

    .bottom-hud {
        bottom: 4vh;
        height: 80px;
        overflow: hidden;
        /* Hide the markers sliding out */
    }

    .hud-markers {
        display: flex;
        flex-wrap: nowrap;
        width: max-content !important;
        left: 0 !important;
        padding: 0;
        /* We will use JS to center them */
        transition: none;
        /* GSAP will handle the transition */
    }

    .hud-marker {
        position: relative !important;
        left: auto !important;
        width: 33.333vw !important;
        margin-left: 0 !important;
        flex-shrink: 0;
        height: 100%;
    }

    .hud-line {
        width: 100% !important;
        left: 0 !important;
        z-index: 1;
    }

    .hud-progress-line {
        left: 0 !important;
        z-index: 1;
    }

    .hud-era {
        width: 160px;
        font-size: 12px;
        top: 48px;
        line-height: 1.2;
    }

    .hud-period {
        top: 0px;
        font-size: 11px;
    }

    .float-item {
        width: 60vw;
        height: 35vh;
        margin-top: -30vh;
    }

    .desc-text {
        margin-top: 40px;
    }
}