:root {
    --primary-color: #e84393;
    --secondary-color: #2d3436;
    --track-color: #e0e0e0;
    --bg-gradient: linear-gradient(135deg, #fff0f6 0%, #fff5f7 100%);
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--secondary-color);
    padding: 2rem;
    padding-top: 8rem;
    /* Move content higher, but clear header */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Align to top instead of center */
}

header {
    position: absolute;
    top: 2rem;
    left: 2rem;
}

.back-link {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 600;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 95%;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    margin-bottom: 0.1rem;
    /* Even closer to subtitle */
    color: var(--primary-color);
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #636e72;
    margin-bottom: 8rem;
    /* Increased to 8rem */
    font-style: italic;
    font-size: 1.2rem;
    opacity: 0.8;
}

.timeline-item {
    margin-bottom: 4rem;
    position: relative;
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    /* Closer to bar (was 2rem) */
    font-weight: 700;
    font-size: 2rem;
    /* Larger (was 1.4rem) */
    color: var(--secondary-color);
}

.progress-track {
    height: 30px;
    /* Thicker/Chunky */
    background: var(--track-color);
    border-radius: 15px;
    position: relative;
    display: flex;
    align-items: center;
    border: 2px solid rgba(0, 0, 0, 0.05);
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 15px;
    /* Match track */
    position: relative;
    width: 0%;
    /* JS will calculate */
    transition: width 3s ease-in-out;
    /* Slower, smoother fill */
}

.progress-bar.full {
    width: 100%;
    background: #00b894;
    /* Green for completed */
}

/* Face Icons */
.face-icon {
    width: 158px;
    /* Scaled down ~12% from 180px */
    height: 158px;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
    animation: slow-wiggle 3s ease-in-out infinite;
    /* Slow & Funny idle state */
}

@keyframes slow-wiggle {
    0% {
        rotate: 0deg;
    }

    25% {
        rotate: -5deg;
    }

    50% {
        rotate: 5deg;
    }

    75% {
        rotate: -5deg;
    }

    100% {
        rotate: 0deg;
    }
}

.face-lazar {
    transform: scale(0.85);
    /* Scale down by 15% */
}

.moving-face {
    position: absolute;
    right: -79px;
    /* Half of 158px */
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.end-face {
    position: absolute;
    right: -55px;
    /* Adjusted offset */
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    /* Removed grayscale & opacity so it's active/colorful by default */
}

/* Inactive Timeline State (Future Trips) */
.timeline-item.inactive {
    filter: grayscale(100%);
    /* Grayed out */
    transform: scale(0.8);
    /* Smaller by 20% */
    transform-origin: center;
    opacity: 0.5;
    transition: all 0.5s ease;
}

/* Barcelona Special */
.faces-centered {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 5;
}

.centered-label {
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    font-size: 1.1rem;
}

/* Locked Future */
.timeline-item.locked {
    opacity: 0.6;
}

.progress-track.faded {
    background: rgba(0, 0, 0, 0.05);
    border: 2px dashed #ccc;
    background-clip: padding-box;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
    /* Taller to fit text */
}

/* ... existing styles ... */

/* Animation Container for "Meeting" */
.meeting-container {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    /* Placeholder width */
    height: 60px;
}

/* Hidden state for individual faces when merged */
.hidden-face {
    display: none !important;
}

/* The Final "Us" Asset */
.final-asset {
    width: 150px;
    /* Adjust size */
    height: 150px;
    object-fit: contain;
    position: absolute;
    right: -75px;
    /* Center on end */
    top: 50%;
    transform: translateY(-50%) scale(0);
    /* Start hidden */
    z-index: 10;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.final-asset.show {
    transform: translateY(-50%) scale(1);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Quirky Animations */
@keyframes shake {
    0% {
        transform: translateY(-50%) rotate(0deg);
    }

    25% {
        transform: translateY(-50%) rotate(-10deg);
    }

    50% {
        transform: translateY(-50%) rotate(10deg);
    }

    75% {
        transform: translateY(-50%) rotate(-10deg);
    }

    100% {
        transform: translateY(-50%) rotate(0deg);
    }
}

@keyframes popIn {
    0% {
        transform: translateY(-50%) scale(0);
        opacity: 0;
    }

    70% {
        transform: translateY(-50%) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
}

.shake-effect {
    animation: shake 0.8s ease-in-out;
}



/* Future Link Styling */
.future-link {
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.future-link:hover {
    transform: scale(1.5);
    /* Goes EXTRA LARGE */
    color: var(--primary-color);
    text-shadow: 0 2px 10px rgba(232, 67, 147, 0.3);
}

/* "Wiggle Like Stupid" Hover */
@keyframes wiggle-stupid {
    0% {
        rotate: 0deg;
    }

    25% {
        rotate: -15deg;
    }

    50% {
        rotate: 15deg;
    }

    75% {
        rotate: -15deg;
    }

    100% {
        rotate: 0deg;
    }
}

.face-icon:hover,
.final-asset:hover {
    animation: wiggle-stupid 0.3s ease-in-out infinite;
    /* Wiggles fast and continuously */
    cursor: pointer;
    z-index: 20;
    /* Pop on top */
}

@media (max-width: 600px) {
    .face-icon {
        width: 80px;
        height: 80px;
    }

    .moving-face {
        right: -40px;
    }

    .end-face {
        right: -20px;
    }
}

/* Organic Randomness for Wiggle */
/* Vienna Timeline */
#timeline-vienna .moving-face .face-icon {
    animation-delay: 0s;
    animation-duration: 3s;
}

#timeline-vienna .end-face .face-icon {
    animation-delay: -1.2s;
    /* Offset */
    animation-duration: 3.4s;
    /* Different speed */
}

/* Larnaca Timeline */
#timeline-larnaca .moving-face .face-icon {
    animation-delay: -0.5s;
    animation-duration: 2.8s;
}

#timeline-larnaca .end-face .face-icon {
    animation-delay: -2.5s;
    animation-duration: 3.2s;
}

/* Speech Bubbles */
.speech-bubble {
    position: absolute;
    bottom: 110%;
    /* Above the head */
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    /* Hidden by default */
    transition: opacity 0.5s ease;
    z-index: 100;
    pointer-events: none;
    border: 2px solid var(--primary-color);
}

/* Show on Hover of the parent face-container OR when .visible class is added (Mobile Click) */
.moving-face:hover .speech-bubble,
.end-face:hover .speech-bubble,
.speech-bubble.visible {
    opacity: 1;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    bottom: 115%;
    /* Slight lift on hover */
}

/* Bubble Arrow */
.speech-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: var(--primary-color) transparent transparent transparent;
}

/* Hide bubbles on inactive timelines */
.timeline-item.inactive .speech-bubble {
    display: none !important;
}

/* Final Bubble Positioning */
.final-bubble {
    bottom: unset;
    top: -20px;
    /* Position above the final asset */
    left: unset;
    right: -75px;
    /* Center with final asset */
    transform: translateX(50%);
    /* Center it relative to right edge */
    z-index: 101;
}

/* Show Final Bubble on hover of FINAL ASSET */
.final-asset:hover~.final-bubble,
.final-bubble.visible {
    opacity: 1;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}