/* concurrent.quest - Memphis meets Aurora Borealis */

/* ===== CSS Custom Properties ===== */
:root {
    --polar-night: #0b0c1e;
    --lavender-aurora: #e0aaff;
    --teal-aurora: #2dd4bf;
    --magenta-flare: #ff6b9d;
    --solar-yellow: #ffd166;
    --deep-indigo: #1a1b3a;
    --frost-white: #e2e8f0;
    --slate-mist: #64748b;
    --aurora-primary: linear-gradient(135deg, #e0aaff 0%, #2dd4bf 50%, #ff6b9d 100%);
    --aurora-subtle: linear-gradient(135deg, rgba(224,170,255,0.15) 0%, rgba(45,212,191,0.1) 50%, rgba(255,107,157,0.08) 100%);
    --memphis-stripe: repeating-linear-gradient(45deg, #ffd166 0px, #ffd166 4px, transparent 4px, transparent 12px);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--polar-night);
    color: var(--frost-white);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* ===== Noise Overlay ===== */
.noise-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: url(#noise);
    opacity: 0.04;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 10;
}

@media (max-width: 767px) {
    .noise-overlay {
        display: none;
    }
}

/* ===== Sections ===== */
.section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

/* ===== Section 1: Fork ===== */
.section-fork {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--polar-night);
}

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

.fork-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-style: italic;
    font-size: clamp(3rem, 8vw, 7rem);
    color: var(--lavender-aurora);
    text-shadow: 0 0 40px rgba(224, 170, 255, 0.3);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.fork-title .char-wrap {
    display: inline-block;
    overflow: hidden;
}

.fork-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px) rotateX(-20deg);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fork-title .char.visible {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
}

.fork-subtitle {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--teal-aurora);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.8s, transform 0.8s ease 0.8s;
}

.fork-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.fork-dividers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.divider {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--teal-aurora), transparent);
    opacity: 0;
    transform: scaleY(0);
    transition: opacity 1s ease, transform 1s ease;
}

.divider-left {
    left: 25%;
}

.divider-right {
    left: 75%;
}

.section-fork.split .divider {
    opacity: 0.4;
    transform: scaleY(1);
}

/* ===== Zigzag Decorators ===== */
.zigzag-decorator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    z-index: 6;
    pointer-events: none;
}

.zigzag-line {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 2s ease;
}

.zigzag-line.drawn {
    stroke-dashoffset: 0;
}

/* ===== Section 2 & 4: Streams ===== */
.section-execute,
.section-resume {
    background: var(--polar-night);
    padding: 6rem 0;
}

.streams-container {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    min-height: 80vh;
    align-items: start;
}

@media (max-width: 900px) {
    .streams-container {
        grid-template-columns: 1fr;
        gap: 4rem;
    }
}

.stream {
    position: relative;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.stream-left {
    transform: translateX(-60px);
}

.stream-center {
    transform: translateY(30px);
}

.stream-right {
    transform: translateX(60px);
}

.stream.visible {
    opacity: 1;
    transform: translateX(0) translateY(0);
}

.stream-center.visible {
    transition-delay: 0ms;
}

.stream-left.visible {
    transition-delay: 200ms;
}

.stream-right.visible {
    transition-delay: 400ms;
}

/* ===== Memphis Totem ===== */
.memphis-totem {
    width: 80px;
    margin: 0 auto 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transform: perspective(800px) rotateY(5deg) rotateX(-3deg);
    transition: transform 0.15s ease-out;
}

.totem-piece {
    transition: transform 0.3s ease;
}

.totem-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--lavender-aurora);
}

.totem-zigzag-strip {
    width: 80px;
    height: 16px;
    background: var(--memphis-stripe);
    border-radius: 2px;
}

.totem-triangle {
    width: 0;
    height: 0;
    border-left: 35px solid transparent;
    border-right: 35px solid transparent;
    border-bottom: 60px solid var(--magenta-flare);
}

.totem-rect-rounded {
    width: 50px;
    height: 70px;
    background: var(--teal-aurora);
    border-radius: 12px;
}

.totem-half-circle {
    width: 70px;
    height: 35px;
    background: var(--solar-yellow);
    border-radius: 70px 70px 0 0;
}

.totem-diamond {
    width: 40px;
    height: 40px;
    background: var(--magenta-flare);
    transform: rotate(45deg);
}

.totem-circle-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--lavender-aurora);
    opacity: 0.7;
}

/* ===== Process Visualization ===== */
.process-vis {
    margin-top: 2rem;
    transition: transform 0.15s ease-out;
}

.process-svg {
    width: 100%;
    max-width: 200px;
    display: block;
    margin: 0 auto;
}

/* ===== Section Headings ===== */
.section-heading,
.barrier-heading,
.join-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-style: italic;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--lavender-aurora);
    text-shadow: 0 0 40px rgba(224, 170, 255, 0.3);
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
}

.section-heading .char-wrap,
.barrier-heading .char-wrap,
.join-heading .char-wrap,
.fork-title .char-wrap {
    display: inline-block;
    overflow: hidden;
}

.section-heading .char,
.barrier-heading .char,
.join-heading .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px) rotateX(-20deg);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.section-heading .char.visible,
.barrier-heading .char.visible,
.join-heading .char.visible {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
}

/* ===== Narrative Text ===== */
.narrative-block {
    max-width: 38ch;
}

.narrative-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.75;
    color: var(--frost-white);
    margin-bottom: 1.5rem;
}

/* ===== Bubble Capsules ===== */
.bubble-cluster {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-items: flex-end;
    padding-top: 2rem;
}

.bubble {
    border-radius: 50px;
    border: 1px solid rgba(45, 212, 191, 0.4);
    background: rgba(26, 27, 58, 0.6);
    backdrop-filter: blur(4px);
    padding: 0.8rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    will-change: transform;
    transition: transform 0.15s ease-out;
}

.bubble-large {
    width: 240px;
    min-height: 100px;
    padding: 1rem 1.6rem;
}

.bubble-medium {
    width: 180px;
    min-height: 80px;
}

.bubble-small {
    width: 140px;
    min-height: 60px;
    padding: 0.6rem 1.2rem;
}

.bubble-label {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--teal-aurora);
}

.bubble-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--frost-white);
    opacity: 0.8;
    line-height: 1.4;
}

/* Bubble float animations */
@keyframes float-0 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(1.5deg); }
}
@keyframes float-1 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(1.5deg); }
}
@keyframes float-2 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(1.5deg); }
}
@keyframes float-3 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(1.5deg); }
}
@keyframes float-4 {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(1.5deg); }
}

.bubble[data-float='0'] { animation: float-0 3s ease-in-out infinite; }
.bubble[data-float='1'] { animation: float-1 3.7s ease-in-out infinite; }
.bubble[data-float='2'] { animation: float-2 4.4s ease-in-out infinite; }
.bubble[data-float='3'] { animation: float-3 5.1s ease-in-out infinite; }
.bubble[data-float='4'] { animation: float-4 5.8s ease-in-out infinite; }

/* ===== Section 3: Barrier ===== */
.section-barrier {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--polar-night);
    min-height: 100vh;
}

.aurora-wash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0aaff 0%, #2dd4bf 50%, #ff6b9d 100%);
    background-size: 200% 200%;
    animation: aurora-drift 20s ease infinite;
    opacity: 0.2;
    z-index: 1;
}

@keyframes aurora-drift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

.barrier-content {
    position: relative;
    z-index: 5;
    text-align: center;
    max-width: 700px;
    padding: 2rem;
}

.barrier-heading {
    font-size: clamp(3rem, 8vw, 7rem);
}

.barrier-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.3rem);
    line-height: 1.75;
    color: var(--frost-white);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease 0.5s, transform 1s ease 0.5s;
}

.barrier-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Section 4: Resume - Decorative Panel ===== */
.decorative-panel {
    width: 100%;
    max-width: 200px;
    height: 400px;
    margin: 0 auto;
    position: relative;
    background: var(--deep-indigo);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.15s ease-out;
}

.panel-shape {
    position: absolute;
}

.panel-shape-1 {
    top: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--lavender-aurora);
    opacity: 0.8;
}

.panel-shape-2 {
    top: 100px;
    right: 10px;
    width: 80px;
    height: 30px;
    background: var(--memphis-stripe);
    border-radius: 4px;
    transform: rotate(-15deg);
}

.panel-shape-3 {
    bottom: 120px;
    left: 30px;
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 50px solid var(--magenta-flare);
}

.panel-shape-4 {
    bottom: 30px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--teal-aurora);
    border-radius: 8px;
    transform: rotate(30deg);
}

/* ===== Timeline Events ===== */
.timeline-events {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-top: 2rem;
}

.timeline-event {
    position: relative;
    padding: 1rem;
    padding-left: 3rem;
    transition: transform 0.15s ease-out;
}

.event-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.7;
}

.event-circle-1 {
    width: 40px; height: 40px;
    background: var(--lavender-aurora);
    top: 5px; left: 0;
}
.event-circle-2 {
    width: 30px; height: 30px;
    background: var(--teal-aurora);
    top: 15px; left: 20px;
    mix-blend-mode: screen;
}
.event-circle-3 {
    width: 25px; height: 25px;
    background: var(--magenta-flare);
    top: 0; left: 35px;
    mix-blend-mode: screen;
}
.event-circle-4 {
    width: 35px; height: 35px;
    background: var(--magenta-flare);
    top: 5px; left: 0;
}
.event-circle-5 {
    width: 35px; height: 35px;
    background: var(--solar-yellow);
    top: 10px; left: 15px;
    mix-blend-mode: screen;
}
.event-circle-6 {
    width: 30px; height: 30px;
    background: var(--teal-aurora);
    top: 10px; left: 0;
}
.event-circle-7 {
    width: 25px; height: 25px;
    background: var(--lavender-aurora);
    top: 0; left: 15px;
    mix-blend-mode: screen;
}
.event-circle-8 {
    width: 20px; height: 20px;
    background: var(--magenta-flare);
    top: 18px; left: 30px;
    mix-blend-mode: screen;
}
.event-circle-9 {
    width: 45px; height: 45px;
    background: var(--lavender-aurora);
    top: 0; left: 0;
}

.event-label {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--teal-aurora);
    display: block;
    margin-top: 0.5rem;
}

/* ===== Section 5: Join ===== */
.section-join {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--polar-night);
}

.section-join .aurora-wash {
    opacity: 0.25;
}

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

.join-heading {
    font-size: clamp(3rem, 10vw, 8rem);
}

.join-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.3rem);
    line-height: 1.75;
    color: var(--frost-white);
    max-width: 500px;
    margin: 0 auto 3rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease 0.5s, transform 1s ease 0.5s;
}

.join-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Join Composition ===== */
.join-composition {
    position: relative;
    width: 300px;
    height: 200px;
    margin: 0 auto;
    transition: transform 0.15s ease-out;
}

.composition-element {
    position: absolute;
}

.comp-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--lavender-aurora);
    top: 10px;
    left: 20px;
    opacity: 0.9;
}

.comp-triangle {
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 70px solid var(--magenta-flare);
    top: 30px;
    right: 30px;
}

.comp-rect {
    width: 60px;
    height: 90px;
    background: var(--teal-aurora);
    border-radius: 10px;
    bottom: 10px;
    left: 60px;
}

.comp-zigzag {
    width: 120px;
    height: 20px;
    background: var(--memphis-stripe);
    bottom: 40px;
    right: 20px;
    border-radius: 4px;
}

.composition-domain {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-style: italic;
    font-size: 1.5rem;
    color: var(--lavender-aurora);
    text-shadow: 0 0 30px rgba(224, 170, 255, 0.4);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

/* ===== Zigzag Section Decorators ===== */
.zigzag-fork {
    bottom: 20px;
}

.zigzag-execute,
.zigzag-resume {
    position: relative;
    width: 100%;
    height: 30px;
    margin-top: 2rem;
}

.zigzag-join {
    bottom: 40px;
}

/* ===== Tilt-3D base styles ===== */
.tilt-3d {
    transform-style: preserve-3d;
    will-change: transform;
}

/* ===== Stream merge/split transitions ===== */
.section-barrier .stream-left,
.section-barrier .stream-right {
    transform: translateX(0);
    opacity: 0;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .stream-left,
    .stream-right {
        transform: translateX(0) !important;
    }

    .streams-container {
        grid-template-columns: 1fr;
        padding: 0 1.5rem;
    }

    .bubble-cluster {
        align-items: center;
    }

    .memphis-totem {
        margin: 0 auto 2rem;
    }

    .timeline-events {
        padding-left: 1rem;
    }

    .decorative-panel {
        max-width: 160px;
        height: 300px;
    }
}

@media (max-width: 600px) {
    .fork-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .section-heading,
    .barrier-heading {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .join-heading {
        font-size: clamp(3rem, 15vw, 5rem);
    }

    .join-composition {
        width: 220px;
        height: 160px;
    }

    .comp-circle {
        width: 60px;
        height: 60px;
    }
}
