/* ============================================
   ChloeEngine.com — Render Pipeline Showcase
   ============================================ */

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

:root {
    --void-black: #05070E;
    --deep-pipeline: #0B0D1A;
    --reactor-cyan: #00F0FF;
    --signal-amber: #FFB800;
    --bloom-magenta: #FF2D7B;
    --titanium: #C8CCD4;
    --brushed-steel: #3A3F4C;
    --frosted-panel: rgba(255,255,255,0.06);
    --white-hot: #FFFFFF;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void-black);
    color: var(--titanium);
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    overflow-x: hidden;
}

/* --- Typography --- */
.pass-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(36px, 6vw, 72px);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--white-hot);
    line-height: 1.1;
}

.section-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--reactor-cyan);
    display: block;
    margin-bottom: 12px;
}

.body-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: 17px;
    line-height: 1.65;
    color: var(--titanium);
}

.tech-readout {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    color: var(--signal-amber);
    letter-spacing: 0.02em;
}

/* --- Main Scroll Container --- */
#render-pipeline {
    scroll-snap-type: y mandatory;
    overflow-y: auto;
    height: 100vh;
    scroll-behavior: smooth;
}

.render-pass {
    min-height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* --- Pipeline Strip Divider --- */
.pipeline-strip {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--reactor-cyan), var(--signal-amber), var(--bloom-magenta), var(--reactor-cyan));
    background-size: 300% 100%;
    animation: pipelineFlow 8s linear infinite;
    flex-shrink: 0;
}

@keyframes pipelineFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* --- Pass Navigation (Left Edge) --- */
#pass-nav {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#pass-nav.visible {
    opacity: 1;
}

.pass-nav-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--reactor-cyan), var(--signal-amber), var(--bloom-magenta));
    background-size: 100% 300%;
    animation: pipelineFlow 8s linear infinite;
    opacity: 0.3;
    z-index: -1;
}

.pass-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--brushed-steel);
    background: transparent;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s ease;
}

.pass-dot .dot-inner {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brushed-steel);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.pass-dot.active {
    border-color: var(--reactor-cyan);
}

.pass-dot.active .dot-inner {
    background: var(--reactor-cyan);
    box-shadow: 0 0 8px var(--reactor-cyan), 0 0 16px rgba(0, 240, 255, 0.3);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 8px var(--reactor-cyan), 0 0 16px rgba(0, 240, 255, 0.3); }
    50% { box-shadow: 0 0 12px var(--reactor-cyan), 0 0 24px rgba(0, 240, 255, 0.5); }
}

/* --- Frame Counter (Bottom Right) --- */
#frame-counter {
    position: fixed;
    bottom: 16px;
    right: 20px;
    z-index: 100;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 10px;
    color: var(--signal-amber);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#frame-counter.visible {
    opacity: 1;
}

/* --- Scan Line --- */
#scan-line {
    position: fixed;
    top: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--reactor-cyan);
    opacity: 0;
    z-index: 200;
    pointer-events: none;
}

#scan-line.active {
    animation: scanSweep 2s linear forwards;
}

@keyframes scanSweep {
    0% { top: -2px; opacity: 0.15; }
    10% { opacity: 0.15; }
    90% { opacity: 0.15; }
    100% { top: 100vh; opacity: 0; }
}

/* --- Wireframe Ghost Objects --- */
.wireframe-ghost {
    position: absolute;
    opacity: 0.05;
    pointer-events: none;
    will-change: transform;
}

.ghost-cube {
    width: 200px;
    height: 200px;
    top: 15%;
    right: 10%;
    border: 1px solid var(--brushed-steel);
    transform: rotate(45deg) rotateX(30deg);
    animation: ghostRotate 30s linear infinite;
}

.ghost-cube-2 {
    top: auto;
    bottom: 10%;
    right: auto;
    left: 5%;
    width: 150px;
    height: 150px;
}

.ghost-torus {
    width: 250px;
    height: 250px;
    bottom: 10%;
    left: 8%;
    border: 1px solid var(--brushed-steel);
    border-radius: 50%;
    transform: rotateX(60deg);
    animation: ghostRotate 40s linear infinite reverse;
}

.ghost-torus-2 {
    bottom: auto;
    top: 8%;
    left: auto;
    right: 12%;
    width: 180px;
    height: 180px;
}

.ghost-icosa {
    width: 220px;
    height: 220px;
    top: 20%;
    left: 5%;
    border: 1px solid var(--brushed-steel);
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    animation: ghostRotate 35s linear infinite;
}

@keyframes ghostRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   PASS 0 — VERTEX ASSEMBLY (Hero)
   ============================================ */
#pass-0 {
    background: var(--void-black);
}

#vertex-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.vertex-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--white-hot);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
}

.vertex-dot.visible {
    opacity: 1;
}

.vertex-dot.migrating {
    transition: all 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#logotype {
    position: relative;
    z-index: 2;
    text-align: center;
    transition: opacity 0.8s ease;
}

#logotype.hidden {
    opacity: 0;
}

#logotype.visible {
    opacity: 1;
}

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(40px, 8vw, 96px);
    letter-spacing: 0.15em;
    color: var(--white-hot);
}

.logo-text.accent {
    color: var(--reactor-cyan);
}

#hud-strip {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: rgba(5, 7, 14, 0.8);
    border-top: 1px solid var(--brushed-steel);
    z-index: 3;
}

#hud-pass-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 13px;
    color: var(--signal-amber);
    letter-spacing: 0.04em;
}

#hud-timer {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 13px;
    color: var(--signal-amber);
}

/* ============================================
   PASS 1 — LIGHTING PIPELINE
   ============================================ */
#pass-1 {
    background: var(--deep-pipeline);
}

#lighting-scene {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

#wireframe-sphere {
    position: absolute;
    top: 50%;
    left: 40%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border: 1px solid var(--brushed-steel);
    border-radius: 50%;
    box-shadow:
        inset 0 0 0 1px var(--brushed-steel),
        inset 60px 0 0 -59px var(--brushed-steel),
        inset -60px 0 0 -59px var(--brushed-steel),
        inset 0 60px 0 -59px var(--brushed-steel),
        inset 0 -60px 0 -59px var(--brushed-steel);
}

/* Wireframe cross lines via pseudo-elements */
#wireframe-sphere::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--brushed-steel);
    opacity: 0.5;
}

#wireframe-sphere::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background: var(--brushed-steel);
    opacity: 0.5;
}

.light-orb {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    mix-blend-mode: screen;
    pointer-events: none;
    filter: blur(40px);
    will-change: transform;
}

.orb-cyan {
    background: radial-gradient(circle, var(--reactor-cyan), transparent 70%);
    top: 30%;
    left: 25%;
    animation: orbitCyan 12s ease-in-out infinite;
}

.orb-amber {
    background: radial-gradient(circle, var(--signal-amber), transparent 70%);
    top: 50%;
    left: 45%;
    animation: orbitAmber 14s ease-in-out infinite;
}

.orb-magenta {
    background: radial-gradient(circle, var(--bloom-magenta), transparent 70%);
    top: 40%;
    left: 35%;
    animation: orbitMagenta 10s ease-in-out infinite;
}

@keyframes orbitCyan {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(80px, -60px); }
    50% { transform: translate(160px, 20px); }
    75% { transform: translate(40px, 80px); }
}

@keyframes orbitAmber {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-70px, 50px); }
    50% { transform: translate(-30px, -80px); }
    75% { transform: translate(60px, -20px); }
}

@keyframes orbitMagenta {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(50px, 70px); }
    50% { transform: translate(-60px, 40px); }
    75% { transform: translate(-40px, -50px); }
}

#lighting-content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    padding: 0 60px;
}

.frosted-panel {
    background: var(--frosted-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 40px;
    max-width: 480px;
}

.frosted-panel .body-text {
    margin: 16px 0 24px;
}

/* ============================================
   PASS 2 — PARTICLE SYSTEMS
   ============================================ */
#pass-2 {
    background: var(--void-black);
    justify-content: flex-start;
    padding-top: 80px;
}

.pass2-label, .pass2-title {
    z-index: 2;
}

.pass2-title {
    margin-bottom: 32px;
}

#particle-scroll {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0 20vw 0 20vw;
    width: 100%;
    flex-shrink: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#particle-scroll::-webkit-scrollbar {
    display: none;
}

.particle-card {
    flex: 0 0 60vw;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.particle-viewport {
    width: 100%;
    height: 50vh;
    background: var(--deep-pipeline);
    border: 1px solid var(--brushed-steel);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.particle-readout {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    color: var(--signal-amber);
    text-align: center;
}

/* Ember particles */
.ember {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, var(--signal-amber), #FF6B00);
    animation: emberRise linear infinite;
    will-change: transform;
}

@keyframes emberRise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-55vh) translateX(var(--drift));
        opacity: 0;
    }
}

/* Rain particles */
.raindrop {
    position: absolute;
    width: 1px;
    height: 14px;
    background: linear-gradient(180deg, rgba(0, 240, 255, 0.6), transparent);
    animation: rainFall linear infinite;
    will-change: transform;
}

@keyframes rainFall {
    0% {
        transform: translateY(-20px) translateX(0);
        opacity: 0.7;
    }
    100% {
        transform: translateY(55vh) translateX(40px);
        opacity: 0;
    }
}

/* Energy pulse particles */
.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1px solid var(--bloom-magenta);
    transform: translate(-50%, -50%) scale(0);
    animation: pulseExpand ease-out infinite;
    will-change: transform;
}

@keyframes pulseExpand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* ============================================
   PASS 3 — SHADER PIPELINE
   ============================================ */
#pass-3 {
    background: var(--deep-pipeline);
    padding-top: 60px;
}

.pass3-label, .pass3-title {
    z-index: 5;
}

.pass3-title {
    margin-bottom: 24px;
}

#shader-compare {
    position: relative;
    width: 80vw;
    max-width: 1000px;
    height: 50vh;
    border: 1px solid var(--brushed-steel);
    border-radius: 2px;
    overflow: hidden;
}

#shader-before, #shader-after {
    position: absolute;
    inset: 0;
}

#shader-before {
    z-index: 2;
    clip-path: inset(0 50% 0 0);
}

#shader-after {
    z-index: 1;
}

.shader-scene {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 40px;
    padding-bottom: 60px;
}

.shader-scene.flat {
    background: #12141F;
    filter: grayscale(1) contrast(0.8);
}

.shader-scene.pbr {
    background: linear-gradient(180deg, #0B0D1A 0%, #151830 40%, #1a1540 100%);
}

.shader-scene.pbr .shape-sphere {
    background: radial-gradient(circle at 35% 35%, var(--reactor-cyan), #0a3a5c 50%, #051020 100%);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.3), 0 20px 40px rgba(0, 0, 0, 0.6);
}

.shader-scene.pbr .shape-cube {
    background: linear-gradient(135deg, var(--signal-amber), #8B6914 60%, #3a2a00 100%);
    box-shadow: 0 0 30px rgba(255, 184, 0, 0.2), 0 20px 40px rgba(0, 0, 0, 0.6);
}

.shader-scene.pbr .shape-ground {
    background: linear-gradient(180deg, #1a1540, #0B0D1A);
    box-shadow: 0 0 80px rgba(255, 45, 123, 0.1);
}

.shape-sphere {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #3A3F4C;
    flex-shrink: 0;
}

.shape-cube {
    width: 100px;
    height: 100px;
    background: #3A3F4C;
    border-radius: 2px;
    flex-shrink: 0;
}

.shape-ground {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #1E2030;
}

.shader-label {
    position: absolute;
    bottom: 12px;
    left: 16px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--signal-amber);
    z-index: 3;
}

#shader-after .shader-label {
    left: auto;
    right: 16px;
}

#shader-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    z-index: 10;
    cursor: ew-resize;
}

.divider-line {
    position: absolute;
    inset: 0;
    background: var(--reactor-cyan);
    box-shadow: 0 0 8px var(--reactor-cyan);
}

.divider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 44px;
    background: rgba(5, 7, 14, 0.8);
    border: 1px solid var(--reactor-cyan);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ew-resize;
}

.shader-readout {
    margin-top: 16px;
    text-align: center;
}

/* ============================================
   PASS 4 — OUTPUT BUFFER
   ============================================ */
#pass-4 {
    background: var(--void-black);
    min-height: 100vh;
}

#final-scene {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.scene-layer {
    position: absolute;
    inset: 0;
}

.scene-sky {
    background: linear-gradient(180deg, #05070E 0%, #0B0D1A 30%, #151030 60%, #1a0a2e 100%);
}

.scene-mountains {
    bottom: 20%;
    top: auto;
    height: 45%;
    background: linear-gradient(180deg, transparent 0%, #0a0c1a 30%);
    clip-path: polygon(0% 100%, 5% 60%, 15% 80%, 25% 45%, 35% 65%, 45% 30%, 55% 55%, 65% 25%, 75% 50%, 85% 35%, 95% 55%, 100% 40%, 100% 100%);
}

.scene-fog {
    bottom: 15%;
    top: auto;
    height: 30%;
    background: linear-gradient(180deg, transparent, rgba(0, 240, 255, 0.03) 50%, rgba(255, 184, 0, 0.02));
    filter: blur(20px);
}

.scene-ground {
    bottom: 0;
    top: auto;
    height: 20%;
    background: linear-gradient(180deg, transparent, #05070E);
}

.scene-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.scene-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--white-hot);
    border-radius: 50%;
    opacity: 0;
    animation: sceneFloat 8s ease-in-out infinite;
}

@keyframes sceneFloat {
    0%, 100% { opacity: 0; transform: translateY(0); }
    50% { opacity: 0.6; transform: translateY(-30px); }
}

#output-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 60px 40px;
    max-width: 1100px;
    width: 100%;
}

#output-content .pass-title {
    margin-bottom: 48px;
}

.output-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 20px;
}

.glass-card {
    background: var(--frosted-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 32px;
    text-align: left;
}

.card-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.1em;
    color: var(--reactor-cyan);
    margin-bottom: 20px;
}

.spec-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spec-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(58, 63, 76, 0.4);
}

.spec-key {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--signal-amber);
}

.spec-val {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: var(--titanium);
}

.cta-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.cta-card .body-text {
    margin: 12px 0 28px;
    font-size: 15px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    background: var(--reactor-cyan);
    color: var(--void-black);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 2px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    background: var(--white-hot);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4), 0 0 40px rgba(0, 240, 255, 0.2);
}

.cta-icon {
    display: block;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    #pass-nav {
        left: 12px;
        gap: 18px;
    }

    .pass-dot {
        width: 12px;
        height: 12px;
    }

    .pass-dot .dot-inner {
        width: 4px;
        height: 4px;
    }

    #lighting-content {
        padding: 0 24px;
    }

    .frosted-panel {
        max-width: 100%;
        padding: 24px;
    }

    #particle-scroll {
        padding: 0 10vw;
    }

    .particle-card {
        flex: 0 0 80vw;
    }

    #shader-compare {
        width: 92vw;
        height: 40vh;
    }

    .output-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .logo-text {
        font-size: clamp(28px, 7vw, 60px);
    }

    #wireframe-sphere {
        width: 200px;
        height: 200px;
    }
}
