/* parallengine.com - Retro-Futuristic / Organic Flow / Warm-Earthy */

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

body {
    background-color: #1A1408;
    font-family: 'Source Sans 3', sans-serif;
    color: #C8B090;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Background grid */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        repeating-linear-gradient(
            to right,
            rgba(138, 106, 74, 0.06) 0px,
            rgba(138, 106, 74, 0.06) 0.5px,
            transparent 0.5px,
            transparent 40px
        ),
        repeating-linear-gradient(
            to bottom,
            rgba(138, 106, 74, 0.06) 0px,
            rgba(138, 106, 74, 0.06) 0.5px,
            transparent 0.5px,
            transparent 40px
        );
}

/* Flow guide path */
.flow-path-svg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1200px;
    height: 4000px;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 1s ease;
}

.flow-path-svg.visible {
    opacity: 1;
}

/* Organic flow container */
.organic-flow {
    position: relative;
    z-index: 2;
    padding: 120px 40px 160px;
    max-width: 1100px;
    margin: 0 auto;
}

/* Flow blocks */
.flow-block {
    max-width: 560px;
    margin-bottom: 120px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    position: relative;
}

.flow-block.in-view {
    opacity: 1;
    transform: translateY(0);
}

.flow-left {
    margin-right: auto;
}

.flow-right {
    margin-left: auto;
}

/* Gradient orbs */
.gradient-orb {
    position: absolute;
    top: -40px;
    left: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 148, 74, 0.1) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.flow-block.in-view .gradient-orb {
    opacity: 1;
}

/* Typography */
.display-heading {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 36px;
    letter-spacing: 0.02em;
    color: #F5E6D0;
    margin-bottom: 20px;
    line-height: 1.2;
    transition: transform 0.1s ease;
}

#site-title {
    font-size: 48px;
    margin-bottom: 16px;
}

.body-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    color: #C8B090;
    margin-bottom: 16px;
}

.data-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8A6A4A;
    display: block;
    margin-bottom: 12px;
}

/* Engine diagrams */
.engine-diagram {
    margin-bottom: 80px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.engine-diagram.in-view {
    opacity: 1;
}

.diagram-left {
    text-align: left;
    padding-left: 60px;
}

.diagram-right {
    text-align: right;
    padding-right: 60px;
}

.diagram-svg {
    display: inline-block;
}

/* Gear rotation */
.gear-rotate {
    transform-origin: 100px 100px;
    animation: gear-spin 30s linear infinite;
    animation-play-state: paused;
}

.engine-diagram.in-view .gear-rotate {
    animation-play-state: running;
}

@keyframes gear-spin {
    to { transform: rotate(360deg); }
}

/* Belt oscillation */
.belt-top, .belt-bottom {
    animation: belt-oscillate 4s ease-in-out infinite alternate;
    animation-play-state: paused;
}

.engine-diagram.in-view .belt-top,
.engine-diagram.in-view .belt-bottom {
    animation-play-state: running;
}

@keyframes belt-oscillate {
    0% { transform: translateX(0); }
    100% { transform: translateX(8px); }
}

/* Piston animation */
.piston-head {
    animation: piston-move 2s ease-in-out infinite alternate;
    animation-play-state: paused;
}

.engine-diagram.in-view .piston-head {
    animation-play-state: running;
}

@keyframes piston-move {
    0% { transform: translateY(0); }
    100% { transform: translateY(15px); }
}

/* Stroke draw animation for SVG diagrams */
.diagram-svg path,
.diagram-svg line,
.diagram-svg circle,
.diagram-svg rect {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1.5s ease;
}

.engine-diagram.in-view .diagram-svg path,
.engine-diagram.in-view .diagram-svg line,
.engine-diagram.in-view .diagram-svg circle,
.engine-diagram.in-view .diagram-svg rect {
    stroke-dashoffset: 0;
}

/* Navigation dots */
.nav-dots {
    position: fixed;
    bottom: 40px;
    right: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid #D4944A;
    background: transparent;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
}

.nav-dot.active {
    background: #D4944A;
}

.nav-dot:hover {
    background: #A07040;
}

/* Halftone overlay on content blocks */
.flow-block::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background-image: radial-gradient(circle, #8A6A4A 0.5px, transparent 0.5px);
    background-size: 6px 6px;
    opacity: 0.08;
    pointer-events: none;
    z-index: -1;
}

/* Magnetic spring-back */
.magnetic {
    transition: transform 0.1s ease;
}

.magnetic.spring-back {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .organic-flow {
        padding: 80px 20px 120px;
    }

    .flow-block {
        max-width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .flow-left,
    .flow-right {
        margin-left: 0;
        margin-right: 0;
    }

    #site-title {
        font-size: 28px;
    }

    .display-heading {
        font-size: 24px;
    }

    .engine-diagram {
        text-align: center !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .diagram-svg {
        transform: scale(0.6);
    }

    .nav-dots {
        bottom: 20px;
        right: 20px;
    }

    .flow-path-svg {
        display: none;
    }
}
