/* concurrengine.com -- concurrent execution engine */
/* Palette: #0b0e17, #151a2e, #5a6a8a, #c8d3e6, #f0f4ff, #7b61ff, #e8a317, #00d4aa */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #0b0e17;
    color: #c8d3e6;
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* Execution lane lines */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: repeating-linear-gradient(
        to right,
        transparent,
        transparent calc(8.333% - 0.5px),
        rgba(90, 106, 138, 0.08) calc(8.333% - 0.5px),
        rgba(90, 106, 138, 0.08) calc(8.333% + 0.5px),
        transparent calc(8.333% + 0.5px)
    );
}

/* Process ID header */
.process-id {
    position: fixed;
    top: 1rem;
    left: 1.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: #5a6a8a;
    letter-spacing: 0.08em;
    z-index: 100;
}

.pid-blink {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Acts (sections) */
.act {
    position: relative;
    z-index: 1;
}

/* Thread grid */
.thread-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
}

/* Act I: Surface */
.act-surface {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.act-surface .thread-grid {
    display: flex;
    justify-content: center;
}

.title-block {
    text-align: center;
}

.hero-title {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title-line {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.04em;
    color: #f0f4ff;
    display: block;
    opacity: 0;
    transform: translateX(-40px);
    animation: titleSlideIn 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.title-line-2 {
    transform: translateX(40px);
    animation-delay: 0.3s;
}

@keyframes titleSlideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-desc {
    font-family: 'Commissioner', sans-serif;
    font-weight: 350;
    font-size: 1.05rem;
    color: #5a6a8a;
    margin-top: 2rem;
    letter-spacing: 0.02em;
    opacity: 0;
    animation: fadeUp 1s ease-out 1s forwards;
}

@keyframes fadeUp {
    from { transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.thread-alpha { color: #00d4aa; }
.thread-beta { color: #e8a317; }
.thread-gamma { color: #7b61ff; }

/* Synchronization barriers */
.sync-barrier {
    width: 100%;
    padding: 2rem 0;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.barrier-svg {
    width: 100%;
    height: 24px;
}

.mutex-diamond {
    animation: diamondPulse 3s ease-in-out infinite;
}

.mutex-diamond:nth-child(3) { animation-delay: 0.3s; }
.mutex-diamond:nth-child(4) { animation-delay: 0.6s; }
.mutex-diamond:nth-child(5) { animation-delay: 0.9s; }
.mutex-diamond:nth-child(6) { animation-delay: 1.2s; }
.mutex-diamond:nth-child(7) { animation-delay: 1.5s; }

@keyframes diamondPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Act II: Mechanism */
.act-mechanism {
    padding: 4rem 0;
}

.mechanism-row {
    margin-bottom: 1rem;
    align-items: start;
}

/* Process blocks */
.process-block {
    position: relative;
    background: #151a2e;
    border: 1px solid rgba(90, 106, 138, 0.25);
    padding: 2.5rem 2rem;
    margin: 1rem 0;
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                border-color 0.4s ease;
}

.process-block:hover {
    transform: translateY(-3px);
    border-color: rgba(123, 97, 255, 0.5);
}

.block-left {
    grid-column: 1 / 7;
}

.block-right-pos {
    grid-column: 7 / 13;
}

.block-full {
    grid-column: 1 / 13;
}

/* Isometric faces */
.block-face {
    position: absolute;
}

.block-top {
    top: -6px;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(to bottom, rgba(123, 97, 255, 0.15), transparent);
}

.block-right {
    top: 0;
    right: -6px;
    bottom: 0;
    width: 6px;
    background: linear-gradient(to right, rgba(90, 106, 138, 0.12), transparent);
}

/* Block content */
.block-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: #5a6a8a;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.75rem;
}

[data-thread="alpha"] .block-label { color: #00d4aa; }
[data-thread="beta"] .block-label { color: #e8a317; }
[data-thread="gamma"] .block-label { color: #7b61ff; }

.block-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: #f0f4ff;
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.block-text {
    font-family: 'Commissioner', sans-serif;
    font-weight: 350;
    font-size: 0.95rem;
    color: #c8d3e6;
    line-height: 1.7;
}

/* Reveal animation */
.reveal-block {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Data flow connectors */
.data-connector {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: block;
    height: 80px;
    overflow: visible;
}

.connector-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 1.5s ease-out;
}

.connector-path.drawn {
    stroke-dashoffset: 0;
}

/* Act III: Convergence */
.act-convergence {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.convergence-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(123, 97, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.convergence-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.convergence-statement {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: #5a6a8a;
    max-width: 42rem;
    margin: 0 auto 3rem;
    line-height: 1.8;
}

.typewriter-block {
    margin-bottom: 3rem;
    min-height: 2rem;
}

.typewriter-text {
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    color: #00d4aa;
    letter-spacing: 0.05em;
}

.typewriter-cursor {
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    color: #00d4aa;
    animation: blink 0.8s step-end infinite;
}

.convergence-domain {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #f0f4ff;
    letter-spacing: 0.04em;
}

/* Responsive */
@media (max-width: 768px) {
    .block-left,
    .block-right-pos,
    .block-full {
        grid-column: 1 / 13;
    }

    .mechanism-row {
        grid-template-columns: 1fr;
    }

    .process-block {
        padding: 1.5rem 1.25rem;
    }

    .data-connector {
        height: 50px;
    }
}
