/**
 * ABOUT SCROLLYTELLING - DARK THEME
 * Scroll-triggered animations and interactive storytelling
 */

/* ========================================
   RESET & REMOVE TOP SPACE - AGGRESSIVE OVERRIDE
   ======================================== */

/* Remove all default spacing - SUPER AGGRESSIVE */
body.page-template-template-about-scrollytelling,
body.page-template-template-about-scrollytelling.et-db,
body.page-template-template-about-scrollytelling.et_divi_theme {
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove Divi default padding - AGGRESSIVE */
.page-template-template-about-scrollytelling #main-content,
.page-template-template-about-scrollytelling .et_builder_inner_content,
.page-template-template-about-scrollytelling #et-main-area,
body.page-template-template-about-scrollytelling #main-content {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
}

/* Remove container padding */
.page-template-template-about-scrollytelling .container,
.page-template-template-about-scrollytelling .et_pb_section {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Remove hero section top padding - FORCE OVERRIDE */
.page-template-template-about-scrollytelling .dark-hero,
.page-template-template-about-scrollytelling section.dark-hero,
body.page-template-template-about-scrollytelling .dark-hero {
    padding-top: 100px !important; /* Account for header + small gap */
    margin-top: 0 !important;
}

/* Ensure progress bar starts at very top */
.scroll-progress-container {
    top: 0 !important;
    margin-top: 0 !important;
    z-index: 99999 !important;
}

/* Remove any gap between header and content */
.page-template-template-about-scrollytelling #page-container,
body.page-template-template-about-scrollytelling #page-container {
    padding-top: 0 !important;
}

/* ========================================
   SCROLL PROGRESS INDICATOR
   ======================================== */

.scroll-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.scroll-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8CA464 0%, #7E8D77 50%, #8CA464 100%);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 20px rgba(140, 164, 100, 0.5);
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ========================================
   SCROLLYTELLING CONTAINER
   ======================================== */

.scrollytelling-container {
    overflow-x: hidden;
}

.scroll-section {
    position: relative;
    width: 100%;
}

.scroll-content-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ========================================
   SCROLL ANIMATIONS - PROFESSIONAL & SMOOTH
   ======================================== */

/* Subtle slide from bottom - for text content */
.scroll-fade-in {
    transform: translateY(40px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-fade-in.active {
    transform: translateY(0);
}

/* Slide from left - smooth and professional */
.scroll-slide-left {
    transform: translateX(-60px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-slide-left.active {
    transform: translateX(0);
}

/* Slide from right */
.scroll-slide-right {
    transform: translateX(60px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-slide-right.active {
    transform: translateX(0);
}

/* Keep for timeline only */
.scroll-slide-up {
    transform: translateY(60px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-slide-up.active {
    transform: translateY(0);
}

/* Gentle scale - very subtle */
.scroll-scale-in {
    transform: scale(0.9);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-scale-in.active {
    transform: scale(1);
}

/* Device icons - NO ANIMATION */
.scroll-rotate-in {
    transform: none;
}

.scroll-rotate-in.active {
    transform: none;
}

/* ========================================
   STATS GRID
   ======================================== */

.stat-card {
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 16px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-family: var(--dark-font-heading);
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #8CA464, #7E8D77);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   TIMELINE
   ======================================== */

/* Timeline Section */
#story {
    scroll-behavior: smooth;
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 0;
}

/* Timeline center line */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg,
        rgba(140, 164, 100, 0.3) 0%,
        rgba(126, 141, 119, 0.3) 50%,
        rgba(140, 164, 100, 0.3) 100%);
    transform: translateX(-50%);
    box-shadow: 0 0 20px rgba(140, 164, 100, 0.3);
    transition: box-shadow 0.5s ease;
}

.timeline:hover::before {
    box-shadow: 0 0 30px rgba(140, 164, 100, 0.5);
}

/* Timeline Progress Line - Animated with scroll */
.timeline-progress-line {
    position: absolute;
    left: 50%;
    top: 0;
    width: 4px;
    height: 0%;
    transform: translateX(-50%);
    background: linear-gradient(180deg,
        rgba(140, 164, 100, 0.9) 0%,
        rgba(126, 141, 119, 0.9) 50%,
        rgba(140, 164, 100, 0.9) 100%);
    box-shadow: 0 0 30px rgba(140, 164, 100, 0.8),
                0 0 60px rgba(140, 164, 100, 0.4),
                0 0 100px rgba(126, 141, 119, 0.3);
    transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
    border-radius: 2px;
}

/* Progress line animated tip */
.timeline-progress-line::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: radial-gradient(circle, #8CA464 0%, rgba(140, 164, 100, 0.4) 100%);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(140, 164, 100, 1),
                0 0 40px rgba(140, 164, 100, 0.6),
                0 0 60px rgba(126, 141, 119, 0.4);
    animation: pulse-tip 2s ease-in-out infinite;
}

@keyframes pulse-tip {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) scale(1.3);
        opacity: 0.8;
    }
}

/* Glow trail effect */
.timeline-progress-line::before {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, rgba(140, 164, 100, 0.6), transparent 70%);
    filter: blur(15px);
    animation: trail-fade 1.5s ease-in-out infinite;
}

@keyframes trail-fade {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.8;
    }
}

/* Smooth background transition for timeline section */
#story {
    background: linear-gradient(180deg,
        rgba(13, 13, 13, 1) 0%,
        rgba(20, 20, 40, 1) 50%,
        rgba(13, 13, 13, 1) 100%);
    position: relative;
}

#story::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(140, 164, 100, 0.08), transparent 70%);
    filter: blur(80px);
    pointer-events: none;
    animation: float-glow 8s ease-in-out infinite;
}

@keyframes float-glow {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        opacity: 0.5;
    }
    50% {
        transform: translateX(-50%) translateY(-30px);
        opacity: 0.8;
    }
}

.timeline-item {
    position: relative;
    margin-bottom: 80px;
    display: flex;
    align-items: center;
    padding: 60px 0;
}

.timeline-item:nth-child(odd) {
    flex-direction: row;
    text-align: right;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
    text-align: left;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #8CA464;
    border: 4px solid #0D0D0D;
    box-shadow: 0 0 30px rgba(140, 164, 100, 0.6);
    z-index: 10;
    transition: all 0.5s cubic-bezier(0.28, 0, 0, 1);
}

.timeline-item.active .timeline-dot {
    transform: translateX(-50%) scale(1.5);
    box-shadow: 0 0 40px rgba(140, 164, 100, 0.8);
}

.timeline-content {
    width: calc(50% - 60px);
    padding: 32px;
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(30px) scale(0.95);
    filter: blur(2px);
}

.timeline-item.active .timeline-content {
    transform: translateY(0) scale(1);
    border-color: rgba(140, 164, 100, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 40px rgba(140, 164, 100, 0.15);
    filter: blur(0);
}

/* Timeline Item Focus State */
.timeline-item.in-focus .timeline-content {
    transform: translateY(0) scale(1.02);
    border-color: rgba(140, 164, 100, 0.5);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 60px rgba(140, 164, 100, 0.3);
}

.timeline-item.in-focus .timeline-dot {
    transform: translateX(-50%) scale(2);
    box-shadow: 0 0 50px rgba(140, 164, 100, 1), 0 0 100px rgba(140, 164, 100, 0.5);
}

/* Lazy Scroll Visual Feedback */
.timeline-lazy-indicator {
    position: fixed;
    top: 50%;
    right: 40px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timeline-lazy-indicator.visible {
    opacity: 1;
}

.timeline-lazy-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.timeline-lazy-dot.active {
    background: #8CA464;
    transform: scale(1.5);
    box-shadow: 0 0 10px rgba(140, 164, 100, 0.8);
}

.timeline-year {
    font-family: var(--dark-font-mono);
    font-size: 14px;
    color: #8CA464;
    margin-bottom: 12px;
    font-weight: 600;
}

/* ========================================
   INNOVATION SECTION
   ======================================== */

.device-icon-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    padding: 40px;
}

.device-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: rgba(26, 26, 26, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.4s ease,
                border-color 0.4s ease;
}

.device-icon.active {
    border-color: rgba(140, 164, 100, 0.3);
    background: rgba(26, 26, 26, 0.8);
    box-shadow: 0 0 30px rgba(140, 164, 100, 0.2);
}

.device-icon svg {
    transition: transform 0.5s cubic-bezier(0.28, 0, 0, 1);
}

.device-icon:hover svg {
    transform: scale(1.1) rotate(5deg);
}

.innovation-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(140, 164, 100, 0.15), transparent 70%);
    filter: blur(80px);
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feature-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px;
    background: rgba(26, 26, 26, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.28, 0, 0, 1);
}

.feature-item:hover {
    background: rgba(26, 26, 26, 0.5);
    border-color: rgba(140, 164, 100, 0.2);
}

.feature-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(140, 164, 100, 0.1);
    border-radius: 8px;
    flex-shrink: 0;
}

/* ========================================
   IMPACT SECTION
   ======================================== */

.impact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.impact-card {
    padding: 48px 32px;
    text-align: center;
    background: rgba(26, 26, 26, 0.6);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

.impact-card.active {
    transform: scale(1);
    background: rgba(26, 26, 26, 0.9);
    border-color: rgba(140, 164, 100, 0.3);
    box-shadow: 0 0 40px rgba(140, 164, 100, 0.2);
}

.impact-number {
    font-family: var(--dark-font-heading);
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #8CA464, #7E8D77);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.impact-number::after {
    content: '+';
    color: #7E8D77;
}

.impact-label {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   TEAM SECTION
   ======================================== */

.team-values-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.team-value-card {
    padding: 40px;
    text-align: center;
    background: rgba(26, 26, 26, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transform: translateY(30px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.3s ease,
                border-color 0.3s ease;
}

.team-value-card.active {
    transform: translateY(0);
    background: rgba(26, 26, 26, 0.8);
    border-color: rgba(140, 164, 100, 0.3);
}

.team-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(140, 164, 100, 0.1);
    border-radius: 16px;
    border: 1px solid rgba(140, 164, 100, 0.2);
    color: #8CA464;
}

/* ========================================
   VALUES SECTION
   ======================================== */

.values-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    max-width: 1000px;
    margin: 0 auto;
}

.value-card {
    padding: 40px;
    background: rgba(26, 26, 26, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    transform: translateY(30px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.3s ease,
                border-color 0.3s ease;
}

.value-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #8CA464, #7E8D77);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.5s cubic-bezier(0.28, 0, 0, 1);
}

.value-card.active::before {
    transform: scaleY(1);
}

.value-card.active {
    transform: translateY(0);
    background: rgba(26, 26, 26, 0.8);
    border-color: rgba(140, 164, 100, 0.2);
}

.value-number {
    font-family: var(--dark-font-mono);
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    color: rgba(140, 164, 100, 0.1);
    position: absolute;
    top: 20px;
    right: 20px;
}

.value-card.active .value-number {
    color: rgba(140, 164, 100, 0.2);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 980px) {
    .stat-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* Fondateurs Cards - Vertikal di Mobile */
    #fondateurs .value-card {
        grid-column: span 1 !important;
    }

    #fondateurs > div > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        max-width: 400px !important;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        flex-direction: row;
        text-align: left;
        padding-left: 60px;
    }

    .timeline-dot {
        left: 20px;
    }

    .timeline-content {
        width: 100%;
    }

    .timeline-lazy-indicator {
        right: 20px;
    }

    /* Mobile timeline progress line adjustments */
    .timeline-progress-line {
        width: 3px;
    }

    .timeline-progress-line::after {
        width: 12px;
        height: 12px;
        bottom: -6px;
    }

    .timeline-progress-line::before {
        width: 20px;
        height: 20px;
        bottom: -20px;
    }

    .device-icon-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 20px;
    }

    .impact-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .team-values-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .values-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .scroll-section {
        padding: 60px 0 !important;
    }

    .scroll-content-wrapper {
        min-height: 80vh;
    }
}

@media (max-width: 640px) {
    .impact-grid {
        grid-template-columns: 1fr;
    }

    .device-icon-grid {
        grid-template-columns: 1fr;
    }

    .impact-number {
        font-size: 48px;
    }

    .value-number {
        font-size: 48px;
    }
}

/* ========================================
   SMOOTH SCROLLING & PERFORMANCE
   ======================================== */

html {
    scroll-behavior: smooth;
}

/* Hardware acceleration for better performance */
.scroll-section {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Optimize animations */
.dark-card,
.timeline-content,
.impact-card,
.value-card,
.team-value-card {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .scroll-fade-in,
    .scroll-slide-left,
    .scroll-slide-right,
    .scroll-slide-up,
    .scroll-scale-in,
    .scroll-rotate-in {
        transform: none;
    }
}

/* Hide scrollbar but keep functionality */
.scrollytelling-container::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* Optimize text rendering */
.scrollytelling-container {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
