/* ==========================================================================
   Toonz Ecosystem Widget Premium Styles (Cinematic Layout)
   ========================================================================== */

.toonz-ecosystem-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 100px 50px;
    color: #131315;
    font-family: 'Outfit', 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

/* ==========================================================================
   Header Section
   ========================================================================== */

.toonz-eco-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 70px;
}

.toonz-eco-accent-dash {
    width: 25px;
    height: 2px;
    background-color: #E87722;
    margin-bottom: 22px;
}

.toonz-eco-heading {
    font-size: clamp(34px, 3.8vw, 50px);
    font-weight: 800;
    line-height: 1.25;
    margin: 0;
    letter-spacing: -1.5px;
    color: #131315;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.toonz-eco-line {
    display: block;
}

.toonz-eco-dot {
    color: #E87722;
    font-weight: 800;
}

.toonz-eco-accent-line {
    width: 45px;
    height: 4px;
    background-color: #E87722;
    margin-top: 25px;
}

/* ==========================================================================
   Central Visual Diagram & Reflective Flows
   ========================================================================== */

.toonz-eco-diagram-container {
    width: 100%;
    height: 450px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    box-sizing: border-box;
    perspective: 1400px;
    transform-style: preserve-3d;
}

/* SVG Network Connections */
.toonz-eco-network-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.toonz-eco-path-anim {
    stroke-dasharray: 8 18;
    animation: toonz-eco-flow-pulse 30s linear infinite;
}

@keyframes toonz-eco-flow-pulse {
    from {
        stroke-dashoffset: 0;
    }

    to {
        stroke-dashoffset: -500;
    }
}

/* Side Nodes Base */
.toonz-eco-side-node {
    position: absolute;
    top: 0;
    width: 38%;
    height: 100%;
    z-index: 2;
    perspective: 1200px;
    transform-style: preserve-3d;
}

.toonz-eco-side-left {
    left: -3%;
}

.toonz-eco-side-right {
    right: -3%;
}

/* Reflective Screens/Cards styling */
.toonz-eco-card {
    position: absolute;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid #1a1a1c;
    border-radius: 6px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    cursor: pointer;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), transform 1.2s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

.toonz-eco-side-left .toonz-eco-card {
    transform: rotateY(42deg) rotateX(5deg) rotateZ(-3deg) translateY(40px);
}

.toonz-eco-side-right .toonz-eco-card {
    transform: rotateY(-42deg) rotateX(5deg) rotateZ(3deg) translateY(40px);
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-card {
    opacity: 1;
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-side-left .toonz-eco-card {
    transform: rotateY(42deg) rotateX(5deg) rotateZ(-3deg) translateY(0);
    animation: toonz-eco-float-left 5s ease-in-out infinite alternate;
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-side-right .toonz-eco-card {
    transform: rotateY(-42deg) rotateX(5deg) rotateZ(3deg) translateY(0);
    animation: toonz-eco-float-right 5s ease-in-out infinite alternate;
}

.toonz-eco-side-left .toonz-eco-card:hover {
    transform: scale(1.08) rotateY(42deg) rotateX(5deg) rotateZ(-3deg) translateZ(30px) !important;
    border-color: #E87722;
    box-shadow: 0 20px 45px rgba(232, 119, 34, 0.4);
    z-index: 20 !important;
}

.toonz-eco-side-right .toonz-eco-card:hover {
    transform: scale(1.08) rotateY(-42deg) rotateX(5deg) rotateZ(3deg) translateZ(30px) !important;
    border-color: #E87722;
    box-shadow: 0 20px 45px rgba(232, 119, 34, 0.4);
    z-index: 20 !important;
}

/* Screen reflection glare effect */
.toonz-eco-screen-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 60%);
    pointer-events: none;
    z-index: 2;
}

/* Absolute coordinates for left side cards (Create cascade) */
.toonz-eco-node-c1 {
    left: 2%;
    top: 4%;
    width: 110px;
    height: 70px;
    z-index: 3;
    transition-delay: 0.2s;
    animation-delay: 1.4s;
}

.toonz-eco-node-c2 {
    left: 10%;
    top: 34%;
    width: 140px;
    height: 88px;
    z-index: 4;
    transition-delay: 0.25s;
    animation-delay: 1.45s;
}

.toonz-eco-node-c3 {
    left: 15%;
    top: 10%;
    width: 130px;
    height: 82px;
    z-index: 5;
    transition-delay: 0.3s;
    animation-delay: 1.5s;
}

.toonz-eco-node-c4 {
    left: 8%;
    top: 60%;
    width: 150px;
    height: 95px;
    z-index: 6;
    transition-delay: 0.35s;
    animation-delay: 1.55s;
}

.toonz-eco-node-c5 {
    left: 22%;
    top: 36%;
    width: 165px;
    height: 104px;
    z-index: 7;
    transition-delay: 0.4s;
    animation-delay: 1.6s;
}

.toonz-eco-node-c6 {
    left: -2%;
    top: 44%;
    width: 110px;
    height: 70px;
    z-index: 2;
    transition-delay: 0.45s;
    animation-delay: 1.65s;
}

.toonz-eco-node-c7 {
    left: 24%;
    top: 14%;
    width: 135px;
    height: 85px;
    z-index: 8;
    transition-delay: 0.5s;
    animation-delay: 1.7s;
}

.toonz-eco-node-c8 {
    left: 18%;
    top: 70%;
    width: 130px;
    height: 82px;
    z-index: 5;
    transition-delay: 0.55s;
    animation-delay: 1.75s;
}

.toonz-eco-node-c9 {
    left: 28%;
    top: 50%;
    width: 160px;
    height: 101px;
    z-index: 9;
    transition-delay: 0.6s;
    animation-delay: 1.8s;
}

.toonz-eco-node-c10 {
    left: 32%;
    top: 78%;
    width: 120px;
    height: 76px;
    z-index: 4;
    transition-delay: 0.65s;
    animation-delay: 1.85s;
}

/* Center Node: PRODUCE (Dominant cinematic monitor screen) */
.toonz-eco-center-monitor {
    width: 480px;
    max-width: 90%;
    position: relative;
    z-index: 10;
    margin: 0 auto;
    perspective: 1000px;
    transform-style: preserve-3d;
    transform: none;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.6s ease;
}

.toonz-eco-center-monitor:hover {
    z-index: 15;
}

.toonz-eco-monitor-bezel {
    border: 9px solid #1a1a1c;
    border-radius: 14px;
    background-color: #0c0c0d;
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.8), 0 0 45px rgba(232, 119, 34, 0.18);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 /10.8;
    box-sizing: border-box;
    transform: rotateY(25deg) rotateX(4deg) rotateZ(360deg);
}

.toonz-eco-monitor-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(125deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 40%, rgba(255, 255, 255, 0) 80%);
    pointer-events: none;
    z-index: 3;
}

.toonz-eco-monitor-content {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 8px;
}

.toonz-eco-brand-badge {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
}

.toonz-eco-monitor-shadow {
    width: 85%;
    height: 10px;
    background: rgba(0, 0, 0, 0.6);
    filter: blur(8px);
    margin: 5px auto 0;
    border-radius: 50%;
}

/* Secondary Cinematic Monitor representing Distribute */
.toonz-eco-monitor-secondary {
    position: absolute;
    right: 18%;
    top: 10%;
    width: 290px;
    height: 180px;
    z-index: 5;
    perspective: 800px;
}

.toonz-eco-monitor-bezel-sec {
    border: 6px solid #161618;
    border-radius: 10px;
    background-color: #0c0c0d;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    position: relative;
    height: 100%;
    box-sizing: border-box;
    transform: rotateY(-30deg) rotateX(3deg) rotateZ(1deg);
}

.toonz-eco-monitor-content-sec {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Absolute coordinates for right side cards */
.toonz-eco-node-r1 {
    right: 4%;
    top: 12%;
    width: 130px;
    height: 82px;
    z-index: 3;
    transition-delay: 0.3s;
    animation-delay: 1.5s;
}

.toonz-eco-node-r2 {
    right: 8%;
    top: 40%;
    width: 142px;
    height: 90px;
    z-index: 4;
    transition-delay: 0.38s;
    animation-delay: 1.58s;
}

.toonz-eco-node-r3 {
    right: -2%;
    top: 44%;
    width: 125px;
    height: 79px;
    z-index: 2;
    transition-delay: 0.46s;
    animation-delay: 1.66s;
}

.toonz-eco-node-r4 {
    right: 18%;
    top: 54%;
    width: 152px;
    height: 96px;
    z-index: 6;
    transition-delay: 0.54s;
    animation-delay: 1.74s;
}

.toonz-eco-node-r5 {
    right: 23%;
    top: 32%;
    width: 115px;
    height: 73px;
    z-index: 3;
    transition-delay: 0.62s;
    animation-delay: 1.82s;
}

/* Decoders & Streaming Consoles styling */
.toonz-eco-console-box {
    position: absolute;
    right: 18%;
    top: 76%;
    width: 75px;
    height: 24px;
    z-index: 8;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.75);
    border-radius: 4px;
    background-color: #0d0d0e;
    border: 1px solid #1a1a1c;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.toonz-eco-console-top {
    height: 3px;
    background-color: #161618;
}

.toonz-eco-console-front {
    height: 19px;
    background-color: #070708;
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 8px;
}

.toonz-eco-console-led {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #E87722;
    box-shadow: 0 0 6px #E87722;
}

.toonz-eco-console-jack {
    width: 6px;
    height: 3px;
    background-color: #1a1a1c;
    border-radius: 1px;
}

/* Game controller for Scale */
.toonz-eco-gamepad-device {
    position: absolute;
    right: 6%;
    top: 78%;
    width: 55px;
    height: 33px;
    z-index: 9;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.7));
}

.toonz-eco-gamepad-svg {
    width: 100%;
    height: 100%;
}

/* 3D Floating Animations preserving Slanted Perspectives */
@keyframes toonz-eco-float-left {
    0% {
        transform: rotateY(42deg) rotateX(5deg) rotateZ(-3deg) translateY(0px);
    }

    100% {
        transform: rotateY(42deg) rotateX(5deg) rotateZ(-3deg) translateY(-16px);
    }
}

@keyframes toonz-eco-float-right {
    0% {
        transform: rotateY(-42deg) rotateX(5deg) rotateZ(3deg) translateY(0px);
    }

    100% {
        transform: rotateY(-42deg) rotateX(5deg) rotateZ(3deg) translateY(-16px);
    }
}

/* ==========================================================================
   Labels Row (CREATE -> PRODUCE -> DISTRIBUTE -> SCALE)
   ========================================================================== */

.toonz-eco-labels-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 25px;
    box-sizing: border-box;
}

.toonz-eco-label-col {
    flex: 1;
    text-align: center;
}

.toonz-eco-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #8c8c92;
    text-transform: uppercase;
}

/* ==========================================================================
   Footer Copy & Positioning Statements
   ========================================================================== */

.toonz-eco-footer-copy {
    width: 100%;
    max-width: 820px;
    margin: 55px auto 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.toonz-eco-desc-block {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.toonz-eco-desc-para {
    font-size: 16px;
    line-height: 1.7;
    margin: 0;
    color: #3f3f46;
    font-weight: 400;
}

.toonz-eco-tag-divider {
    width: 35px;
    height: 2px;
    background-color: #E87722;
    margin: 35px 0;
}

.toonz-eco-taglines {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toonz-eco-tag1 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #131315;
}

.toonz-eco-tag2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #E87722;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1024px) {
    .toonz-ecosystem-wrapper {
        padding: 80px 30px;
    }

    .toonz-eco-diagram-container {
        height: 380px;
    }

    .toonz-eco-center-monitor {
        width: 380px;
    }

    .toonz-eco-monitor-secondary {
        width: 170px;
        height: 104px;
        right: 14%;
        top: 20%;
    }

    .toonz-eco-console-box {
        right: 14%;
        top: 74%;
        width: 60px;
    }

    .toonz-eco-gamepad-device {
        right: 4%;
        top: 75%;
        width: 45px;
    }
}

@media (max-width: 768px) {
    .toonz-ecosystem-wrapper {
        padding: 60px 20px;
    }

    /* Transform relative absolute diagram into a stacked, clean grid layout */
    .toonz-eco-diagram-container {
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 30px;
        align-items: center;
    }

    .toonz-eco-network-svg {
        display: none;
        /* Hide SVG lines on mobile to avoid layout shifts */
    }

    .toonz-eco-side-node {
        position: relative;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100%;
        height: auto;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    .toonz-eco-card {
        position: relative;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: 90px !important;
        height: 58px !important;
        animation: none !important;
    }

    .toonz-eco-center-monitor {
        width: 100%;
        max-width: 450px;
    }

    .toonz-eco-monitor-secondary {
        position: relative;
        top: auto !important;
        right: auto !important;
        width: 180px;
        height: 110px;
    }

    .toonz-eco-console-box,
    .toonz-eco-gamepad-device {
        display: none;
        /* Hide decoders on mobile to declutter */
    }

    .toonz-eco-labels-row {
        flex-direction: column;
        gap: 15px;
        padding-top: 30px;
    }

    .toonz-eco-label-col {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 12px;
        width: 100%;
    }

    .toonz-eco-label-col:last-child {
        border-bottom: none;
    }
}

/* ==========================================================================
   Scroll-Triggered Entrance Animations (IntersectionObserver)
   ========================================================================== */

/* Header Elements Stagger */
.toonz-eco-accent-dash,
.toonz-eco-line,
.toonz-eco-accent-line {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1), transform 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-accent-dash {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.05s;
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-line {
    opacity: 1;
    transform: translateY(0);
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-line:nth-child(1) {
    transition-delay: 0.12s;
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-line:nth-child(2) {
    transition-delay: 0.22s;
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-accent-line {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

/* Center Widescreen Monitor Entrance */
.toonz-eco-center-monitor {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-center-monitor {
    opacity: 1;
    transform: none;
    transition-delay: 0.35s;
}

/* Secondary Monitor Entrance */
.toonz-eco-monitor-secondary {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-monitor-secondary {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.45s;
}

/* Streaming Decoders & Gamepad Controller Stagger */
.toonz-eco-console-box,
.toonz-eco-gamepad-device {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1), transform 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-console-box {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.7s;
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-gamepad-device {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.8s;
}

/* monospaced Labels Entrance */
.toonz-eco-labels-row {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1), transform 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-labels-row {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.9s;
}

/* Footer Strategic Copy Staggers */
.toonz-eco-desc-para,
.toonz-eco-tag-divider,
.toonz-eco-tag1,
.toonz-eco-tag2 {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1), transform 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-desc-para:nth-child(1) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.05s;
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-desc-para:nth-child(2) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.15s;
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-desc-para:nth-child(3) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.25s;
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-tag-divider {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.35s;
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-tag1 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.45s;
}

.toonz-ecosystem-wrapper.is-visible .toonz-eco-tag2 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.55s;
}