/* Storytelling Journey Layout */
.solutions-journey {
    position: relative;
}

/* Full-screen solution sections */
.solution-story {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
}

/* Alternating backgrounds */
.solution-story:nth-child(even) {
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
}

/* Service-specific gradients using theme colors */
.service-story:nth-child(1) {
    background: linear-gradient(135deg, #1A1A1A 0%, #2a2315 50%, #1A1A1A 100%);
}

.service-story:nth-child(2) {
    background: linear-gradient(135deg, #1A1A1A 0%, #1f1a15 50%, #1A1A1A 100%);
}

.service-story:nth-child(3) {
    background: linear-gradient(135deg, #1A1A1A 0%, #231f1a 50%, #1A1A1A 100%);
}

.service-story:nth-child(4) {
    background: linear-gradient(135deg, #1A1A1A 0%, #1a1f23 50%, #1A1A1A 100%);
}

/* Dark mode for services */
.services-journey[data-bs-theme="dark"] .solution-story {
    color: var(--bs-light);
}

/* Remove background image styles since we're not using them */
.story-background {
    display: none;
}

/* Story content container */
.story-content {
    position: relative;
    z-index: 1;
    padding: 4rem 0;
}

/* Story number badge */
.story-number {
    position: absolute;
    top: -2rem;
    left: -2rem;
    font-size: 8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #C69C3F 0%, #B88A37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.15;
    line-height: 1;
    z-index: 0;
}

/* Story statistics */
.story-stat {
    margin-bottom: 1.5rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: #C69C3F;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    display: block;
    line-height: 1;
    margin-bottom: 0.5rem;
}

/* Journey intro */
.journey-intro {
    background: linear-gradient(135deg, #1A1A1A 0%, rgba(26, 26, 26, 0.8) 100%);
    padding: 5rem 0;
    min-height: 40vh;
    display: flex;
    align-items: center;
    position: relative;
}

.journey-intro h2 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.journey-intro .lead {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    max-width: 800px;
    margin: 0 auto;
}

/* Story transition */
.story-transition {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-size: 2rem;
    color: #C69C3F;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Story text content */
.story-text {
    position: relative;
    z-index: 1;
}

.story-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--bs-light);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.story-text .lead {
    font-size: 1.25rem;
    color: var(--bs-gray-300);
    margin-bottom: 2rem;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Visual element */
.story-visual {
    position: relative;
    min-height: 400px;
}

/* Image placeholder styles */
.image-placeholder {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.image-placeholder img {
    transition: transform 0.6s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.image-placeholder:hover img {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.placeholder-fallback {
    background-color: #2a2a2a !important;
    border: 2px dashed rgba(198, 156, 63, 0.3);
    transition: all 0.3s ease;
}

.placeholder-fallback:hover {
    border-color: rgba(198, 156, 63, 0.6);
    background-color: #333 !important;
}

/* Button styling for CTA */
.btn-explore {
    font-size: 1.5rem;
    padding: 1.25rem 3rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 50px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #C69C3F 0%, #B88A37 100%);
    border: none;
    color: var(--bs-dark);
    box-shadow: 0 4px 15px rgba(198, 156, 63, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-explore::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-explore:hover::before {
    left: 100%;
}

.btn-explore:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(198, 156, 63, 0.5);
    color: var(--bs-dark);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

/* Service list - 2 column compact layout */
.service-list {
    margin: 1.5rem 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.service-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border: 1px solid rgba(198, 156, 63, 0.15);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(198, 156, 63, 0.1), transparent);
    transition: left 0.5s ease;
}

.service-item:hover::before {
    left: 100%;
}

.service-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border-color: rgba(198, 156, 63, 0.3);
    transform: translateY(-2px);
}

.solution-story:nth-child(even) .service-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.service-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #C69C3F;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.service-item p {
    font-size: 0.85rem;
    color: var(--bs-gray-300);
    margin: 0;
    line-height: 1.4;
    opacity: 0.9;
}

/* Responsive - single column on mobile */
@media (max-width: 768px) {
    .service-list {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .service-item {
        padding: 0.875rem;
    }
}

/* CTA button styling */
.story-text .btn-primary {
    font-size: 1.125rem;
    padding: 0.75rem 2rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.story-text .btn-primary::after {
    content: '→';
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    transition: right 0.3s ease;
}

.story-text .btn-primary:hover {
    padding-right: 3rem;
}

.story-text .btn-primary:hover::after {
    right: 1.5rem;
}

/* Progress indicator */
.journey-progress {
    position: fixed;
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    z-index: 1000;
}

.progress-dots {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.progress-dot {
    width: 14px;
    height: 14px;
    background: var(--bs-gray-600);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    /* Hexagon shape for all dots */
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    animation: hexagonPulse 2s ease-in-out infinite;
}

@keyframes hexagonPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.05) rotate(3deg); }
}

.progress-dot:hover {
    background: var(--bs-gray-400);
    transform: scale(1.2) rotate(30deg);
    animation: none;
}

.progress-dot.active {
    background: #C69C3F;
    border-color: #C69C3F;
    transform: scale(1.5) rotate(0deg);
    box-shadow: 0 0 20px rgba(198, 156, 63, 0.6);
    animation: hexagonActive 1s ease-in-out infinite alternate;
}

@keyframes hexagonActive {
    0% { 
        transform: scale(1.5) rotate(0deg);
        box-shadow: 0 0 20px rgba(198, 156, 63, 0.6);
    }
    100% { 
        transform: scale(1.6) rotate(6deg);
        box-shadow: 0 0 30px rgba(198, 156, 63, 0.8);
    }
}

/* Tooltip for dots */
.progress-dot::before {
    content: attr(data-section);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bs-dark);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.progress-dot:hover::before {
    opacity: 1;
}

/* Scroll animations */
[data-animate] {
    opacity: 0;
    transition: all 0.8s ease-out;
}

[data-animate="slide-right"] {
    transform: translateX(-50px);
}

[data-animate="slide-left"] {
    transform: translateX(50px);
}

[data-animate="fade-scale"] {
    transform: scale(0.95);
}

[data-animate].in-view {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* Stagger animations for service cards */
.embedded-services .mini-service-card {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease-out;
}

.in-view .embedded-services .mini-service-card {
    opacity: 1;
    transform: translateY(0);
}

.in-view .embedded-services .mini-service-card:nth-child(1) {
    transition-delay: 0.1s;
}

.in-view .embedded-services .mini-service-card:nth-child(2) {
    transition-delay: 0.2s;
}

.in-view .embedded-services .mini-service-card:nth-child(3) {
    transition-delay: 0.3s;
}

/* Mobile responsiveness */
@media (max-width: 991px) {
    .solution-story {
        min-height: 70vh;
    }
    
    .story-content {
        padding: 3rem 1.5rem; /* Add horizontal padding for tablets */
    }
    
    .story-number {
        font-size: 5rem;
        top: -1rem;
        left: -1rem;
    }
    
    .story-text h2 {
        font-size: 2rem;
    }
    
    .story-text .lead {
        font-size: 1.125rem;
    }
    
    .story-visual {
        min-height: 300px;
        margin-top: 2rem;
    }
    
    .story-icon {
        width: 200px;
        height: 200px;
    }
    
    .journey-progress {
        right: 1rem;
    }
    
    .embedded-services {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    /* Control scroll behavior on mobile */
    html, body {
        scroll-snap-type: none !important;
        scroll-behavior: auto; /* Remove smooth scrolling on mobile */
        -webkit-overflow-scrolling: auto; /* Disable momentum scrolling */
        overscroll-behavior: contain; /* Prevent scroll chaining */
    }
    
    /* Ensure the journey sections don't interfere with scrolling */
    .solutions-journey,
    .services-journey {
        overflow: visible !important;
        -webkit-overflow-scrolling: auto;
    }
    
    /* Services journey sections - reduce height on mobile */
    .services-journey .solution-story {
        min-height: auto;
        padding: 3rem 0;
        position: relative;
        /* Add visual separation */
        border-bottom: 1px solid rgba(198, 156, 63, 0.2);
        /* No scroll snap */
        scroll-snap-align: none !important;
    }
    
    /* Solution cards should not have viewport height on mobile */
    .solutions-journey .solution-story {
        min-height: auto !important;
        padding: 2rem 0;
        /* No scroll snap */
        scroll-snap-align: none !important;
    }
    
    /* Critical: Add horizontal padding on mobile */
    .story-content {
        padding: 2rem 1.25rem; /* Comfortable mobile padding */
    }
    
    /* Optimize story number for mobile */
    .story-number {
        font-size: 3.5rem; /* Smaller on mobile */
        opacity: 0.1; /* More subtle */
        top: -0.5rem;
        left: -0.5rem;
    }
    
    /* Better mobile typography */
    .story-text h2 {
        font-size: 1.75rem;
        margin-bottom: 1rem; /* Tighter spacing */
        line-height: 1.3;
    }
    
    .story-text .lead {
        font-size: 1rem; /* More readable size */
        margin-bottom: 1.5rem;
        line-height: 1.5;
    }
    
    /* Make journey intro more prominent on mobile */
    .journey-intro {
        padding: 4rem 1.25rem; /* More generous padding */
        min-height: 50vh; /* Take up half the viewport */
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #1A1A1A 0%, #2a2315 30%, #1A1A1A 100%);
        position: relative;
        overflow: hidden;
        /* No scroll snap */
        scroll-snap-align: none !important;
    }
    
    /* Add decorative element to intro */
    .journey-intro::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle at center, rgba(198, 156, 63, 0.1) 0%, transparent 70%);
        animation: pulse 4s ease-in-out infinite;
    }
    
    .journey-intro .container {
        position: relative;
        z-index: 1;
    }
    
    .journey-intro h2 {
        font-size: 2.5rem !important;
        margin-bottom: 1rem;
        background: linear-gradient(135deg, #C69C3F 0%, #E0B854 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        text-align: center;
    }
    
    .journey-intro .lead {
        font-size: 1.125rem !important;
        color: rgba(255, 255, 255, 0.9) !important;
        text-align: center;
        max-width: 600px;
        margin: 0 auto;
    }
    
    /* Optimize stat numbers for mobile */
    .stat-number {
        font-size: 2.5rem; /* Smaller but still impactful */
        margin-bottom: 0.25rem;
    }
    
    /* Better service list spacing on mobile */
    .service-list {
        margin: 1rem 0;
        gap: 0.625rem; /* Slightly more space between items */
    }
    
    .service-item {
        padding: 1rem; /* More generous padding */
        border-radius: 12px; /* Softer corners */
    }
    
    .service-item h4 {
        font-size: 0.9rem;
        margin-bottom: 0.375rem;
    }
    
    .service-item p {
        font-size: 0.8125rem; /* Slightly larger for readability */
        line-height: 1.5;
    }
    
    /* Touch-friendly buttons */
    .story-text .btn-primary {
        width: 100%;
        text-align: center;
        padding: 1rem 2rem; /* Larger touch target */
        font-size: 1rem;
        margin-top: 1.5rem;
    }
    
    /* Better CTA button on mobile */
    .btn-explore {
        font-size: 1.25rem;
        padding: 1rem 2.5rem;
        width: 100%;
        margin-top: 1.5rem;
    }
    
    /* Hide desktop progress indicator */
    .journey-progress {
        display: none;
    }
    
    /* Add scroll hint to journey intro */
    .journey-intro::after {
        content: 'Scroll to explore';
        position: absolute;
        bottom: 2rem;
        left: 50%;
        transform: translateX(-50%);
        color: var(--gold-light);
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        opacity: 0.7;
        animation: fadeInOut 3s ease-in-out infinite;
    }
    
    /* Ensure no elements have scroll-snap on mobile */
    * {
        scroll-snap-align: none !important;
    }
    
    /* Progress bar styles moved to progress-bar.css */
    
    /* Adjust visual spacing */
    .story-visual {
        margin-top: 1.5rem; /* Less gap on mobile */
        min-height: 250px;
    }
    
    /* Ensure container doesn't overflow */
    .container.story-content {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Add subtle scroll indicator at bottom of each section */
    .solution-story::after {
        content: '';
        position: absolute;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%);
        width: 25px;
        height: 25px;
        border-bottom: 2px solid rgba(198, 156, 63, 0.4);
        border-right: 2px solid rgba(198, 156, 63, 0.4);
        transform: translateX(-50%) rotate(45deg);
        animation: scrollIndicator 2s ease-in-out infinite;
        opacity: 0.5;
    }
    
    /* Hide indicator on last section */
    .solution-story:last-of-type::after {
        display: none;
    }
    
    @keyframes scrollIndicator {
        0%, 100% {
            transform: translateX(-50%) translateY(0) rotate(45deg);
            opacity: 0.5;
        }
        50% {
            transform: translateX(-50%) translateY(8px) rotate(45deg);
            opacity: 0.8;
        }
    }
    
    @keyframes fadeInOut {
        0%, 100% {
            opacity: 0.5;
        }
        50% {
            opacity: 1;
        }
    }
}

/* Extra small devices (phones < 375px) */
@media (max-width: 374px) {
    .story-content {
        padding: 1.5rem 1rem; /* Even tighter padding for very small screens */
    }
    
    .story-text h2 {
        font-size: 1.5rem;
    }
    
    .story-text .lead {
        font-size: 0.9375rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .service-item {
        padding: 0.875rem;
    }
    
    .btn-explore {
        font-size: 1.125rem;
        padding: 0.875rem 2rem;
    }
}

/* Smooth scrolling with scroll-snap support */
html {
    scroll-behavior: smooth;
}

/* Animation for pulse effect */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.15;
    }
}

/* Focus states for accessibility */
.progress-dot:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

.mini-service-card:focus-within {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}