:root {
    --plum: #1a0f2e;
    --blush: #faf4ff;
    --flamingo: #ff6b9d;
    --tangerine: #ff8c42;
    --mint: #00c9a7;
    --lemon: #ffe156;
    --grape: #2d1b4e;
    --lavender: #a892c9;
    --grid-rest: #e8e0f0;
    --grid-dark: #3a2a5c;
    --lavender-shadow: #7b6a9e;
    --blush-white: #faf8ff;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    color: var(--grape);
    background: var(--plum);
    overflow-x: hidden;
}

/* Flow Layer */
.flow-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.flow-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.65, 0, 0.35, 1);
}

.flow-path.revealed {
    stroke-dashoffset: 0;
}

/* Isometric Grid */
.iso-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.iso-grid.visible {
    opacity: 1;
}

.grid-line {
    position: absolute;
    background: var(--grid-rest);
    opacity: 0.3;
    transition: background 0.5s ease, opacity 0.5s ease;
}

.grid-line.pulse {
    background: var(--flamingo);
    opacity: 0.6;
}

/* Sections */
.section {
    position: relative;
    z-index: 2;
}

/* Section 1: Genesis */
.section-genesis {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--plum);
}

.genesis-content {
    text-align: center;
    padding: 2rem;
}

.title-main {
    font-family: 'Righteous', cursive;
    font-size: clamp(2.8rem, 7vw, 6rem);
    line-height: 1.05;
    letter-spacing: 0.03em;
    color: #fef0f5;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUp 1s ease 0.3s forwards;
}

.subtitle {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    color: var(--lavender);
    max-width: 540px;
    margin: 0 auto 3rem;
    opacity: 0;
    animation: fadeInUp 1s ease 0.6s forwards;
}

/* Isometric Cubes */
.cube-assembly {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.iso-cube {
    width: 60px;
    height: 60px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(60deg) rotateZ(-45deg);
    margin-bottom: -20px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    cursor: pointer;
}

.iso-cube:hover {
    transform: rotateX(60deg) rotateZ(-45deg) translateY(-8px);
}

.cube-top, .cube-left, .cube-right {
    position: absolute;
    width: 60px;
    height: 60px;
}

.cube-top {
    transform: translateZ(30px);
    background: var(--flamingo);
}

.cube-left {
    transform: rotateX(-90deg) translateZ(30px);
    background: color-mix(in srgb, var(--flamingo) 70%, black);
}

.cube-right {
    transform: rotateY(90deg) translateZ(30px);
    background: color-mix(in srgb, var(--flamingo) 85%, black);
}

/* Cube color variants */
.cube-flamingo .cube-top { background: var(--flamingo); }
.cube-flamingo .cube-left { background: #d4527e; }
.cube-flamingo .cube-right { background: #e85f8b; }

.cube-tangerine .cube-top { background: var(--tangerine); }
.cube-tangerine .cube-left { background: #d47035; }
.cube-tangerine .cube-right { background: #e87e3c; }

.cube-mint .cube-top { background: var(--mint); }
.cube-mint .cube-left { background: #009e83; }
.cube-mint .cube-right { background: #00b595; }

.cube-lemon .cube-top { background: var(--lemon); }
.cube-lemon .cube-left { background: #d4bc45; }
.cube-lemon .cube-right { background: #e8cf4d; }

.cube-grape .cube-top { background: var(--grape); }
.cube-grape .cube-left { background: #1a0f2e; }
.cube-grape .cube-right { background: #23153d; }

.cube-gradient .cube-top { background: linear-gradient(135deg, var(--flamingo), var(--tangerine)); }
.cube-gradient .cube-left { background: linear-gradient(135deg, var(--tangerine), var(--lemon)); }
.cube-gradient .cube-right { background: linear-gradient(135deg, var(--flamingo), var(--lemon)); }

.cube-large {
    width: 100px;
    height: 100px;
}

.cube-large .cube-top,
.cube-large .cube-left,
.cube-large .cube-right {
    width: 100px;
    height: 100px;
}

.cube-large .cube-top { transform: translateZ(50px); }
.cube-large .cube-left { transform: rotateX(-90deg) translateZ(50px); }
.cube-large .cube-right { transform: rotateY(90deg) translateZ(50px); }

.semi-transparent {
    opacity: 0.6;
}

.cube-genesis {
    opacity: 0;
    animation: cubeEnter 0.6s ease 0.9s forwards;
}

/* Section 2: Growth */
.section-growth {
    min-height: 80vh;
    background: var(--blush);
    padding: 8rem 2rem;
    position: relative;
}

.growth-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 5rem;
}

.concept-block {
    display: flex;
    align-items: center;
    gap: 3rem;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.concept-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.concept-left {
    flex-direction: row;
}

.concept-right {
    flex-direction: row-reverse;
    text-align: right;
}

.concept-center {
    flex-direction: column;
    text-align: center;
}

.concept-text {
    flex: 1;
}

.label-tech {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.75rem, 0.9vw, 0.9rem);
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--flamingo);
    display: block;
    margin-bottom: 0.75rem;
}

.label-mint {
    color: var(--mint);
}

.concept-text p {
    color: var(--grape);
    font-weight: 400;
    max-width: 420px;
}

.concept-right .concept-text p {
    margin-left: auto;
}

.concept-center .concept-text p {
    margin: 0 auto;
}

/* Assembly stacking */
.assembly-1, .assembly-2, .assembly-3, .assembly-4, .assembly-5 {
    display: flex;
    flex-direction: column;
    align-items: center;
    perspective: 600px;
}

/* Section 3: Complexity */
.section-complexity {
    min-height: 80vh;
    background: var(--plum);
    padding: 8rem 2rem;
    position: relative;
    overflow: hidden;
}

.duotone-shape {
    position: absolute;
    border-radius: 50%;
    animation: drift 25s ease-in-out infinite alternate;
}

.shape-1 {
    width: 40vw;
    height: 40vw;
    background: var(--flamingo);
    opacity: 0.12;
    top: 10%;
    left: -10%;
}

.shape-2 {
    width: 25vw;
    height: 25vw;
    background: var(--mint);
    opacity: 0.18;
    bottom: 10%;
    right: -5%;
    animation-delay: -12s;
}

.complexity-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    position: relative;
    z-index: 2;
}

.complex-text {
    text-align: center;
    flex: 1;
}

.section-heading {
    font-family: 'Righteous', cursive;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.05;
    letter-spacing: 0.03em;
    color: #fef0f5;
    margin-bottom: 1.5rem;
}

.complex-text p {
    color: var(--lavender);
    max-width: 400px;
    margin: 0 auto;
}

/* Section 4: Convergence */
.section-convergence {
    min-height: 100vh;
    background: var(--plum);
    display: flex;
    align-items: center;
    justify-content: center;
}

.convergence-content {
    text-align: center;
    padding: 2rem;
}

.convergence-heading {
    font-family: 'Righteous', cursive;
    font-size: clamp(2.4rem, 6vw, 5rem);
    line-height: 1.05;
    letter-spacing: 0.03em;
    color: #fef0f5;
    margin-bottom: 3rem;
    max-width: 700px;
}

.cube-final {
    margin: 0 auto 3rem;
}

.convergence-sub {
    color: var(--lavender);
    font-weight: 400;
    max-width: 480px;
    margin: 0 auto;
    font-style: italic;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cubeEnter {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes drift {
    from {
        transform: translate(5vw, 3vh) rotate(5deg);
    }
    to {
        transform: translate(-5vw, -3vh) rotate(-5deg);
    }
}

@keyframes gridPulse {
    0%, 100% {
        opacity: 0.3;
        background: var(--grid-rest);
    }
    50% {
        opacity: 0.7;
        background: var(--flamingo);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .concept-block {
        flex-direction: column !important;
        text-align: center;
    }

    .concept-right .concept-text p,
    .concept-text p {
        margin: 0 auto;
        max-width: 100%;
    }

    .complexity-content {
        flex-direction: column;
    }

    .iso-cube {
        width: 45px;
        height: 45px;
    }

    .cube-top, .cube-left, .cube-right {
        width: 45px;
        height: 45px;
    }

    .cube-top { transform: translateZ(22px); }
    .cube-left { transform: rotateX(-90deg) translateZ(22px); }
    .cube-right { transform: rotateY(90deg) translateZ(22px); }
}
