:root {
    --bg-primary: #f0f2f5;
    --bg-deep: #2d3748;
    --text-primary: #3a4550;
    --text-body: #4a5568;
    --text-secondary: #718096;
    --grid-lines: #c8cdd3;
    --accent-warm: #d4a89a;
    --accent-cool: #8fa8c8;
    --path-line: #6b7b8d;
    --hover-state: #b8c4d8;
    --surface-light: #e2e8f0;
    --surface-mid: #cbd5e0;
    --label-color: #8e99a4;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    position: relative;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    filter: url(#noise);
    opacity: 0.03;
    z-index: 1000;
}

/* Progress Bar */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 3px;
    height: 100vh;
    background: var(--grid-lines);
    z-index: 100;
}

#progress-fill {
    width: 100%;
    height: 0%;
    background: var(--accent-warm);
    transition: height 100ms linear;
}

/* Supply Chain Path SVG */
.supply-path-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* Grid Canvas */
#grid-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Scenes */
.scene {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    z-index: 10;
    overflow: hidden;
}

.scene-1 { min-height: 150vh; }
.scene-2 { min-height: 120vh; }
.scene-3 {
    min-height: 150vh;
    background: var(--bg-deep);
}
.scene-4 { min-height: 120vh; }
.scene-5 { min-height: 150vh; }

.scene-content {
    max-width: 58ch;
    opacity: 0;
    transform: scale(0.85) translateY(24px);
    transition: opacity 800ms cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scene-content.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.scene-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--label-color);
    display: block;
    margin-bottom: 1.5rem;
}

.scene-3 .scene-label {
    color: var(--accent-cool);
}

.scene-title {
    font-family: 'Fira Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(2.8rem, 7vw, 6rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.scene-3 .scene-title {
    color: #d4dbe2;
}

.scene-text {
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: var(--text-body);
    max-width: 58ch;
    line-height: 1.72;
}

.scene-3 .scene-text {
    color: var(--grid-lines);
}

/* Accent on first and last scenes */
.scene-1 .scene-title::after,
.scene-5 .scene-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--accent-warm);
    margin-top: 1rem;
    border-radius: 2px;
}

/* Hills - Pastoral Shapes */
.hill {
    position: absolute;
    width: 120%;
    height: 200px;
    border-radius: 60% 40% / 70% 30%;
    background: linear-gradient(180deg, var(--surface-light), var(--surface-mid));
    opacity: 0.4;
    z-index: 0;
}

.hill-1 {
    bottom: -60px;
    left: -10%;
}

.hill-2 {
    bottom: -100px;
    right: -20%;
    width: 80%;
    height: 160px;
    border-radius: 50% 50% / 60% 40%;
    opacity: 0.3;
}

.hill-3 {
    bottom: -40px;
    left: -5%;
    width: 110%;
}

.hill-4 {
    bottom: -80px;
    right: -15%;
    width: 90%;
    height: 180px;
    border-radius: 45% 55% / 65% 35%;
    opacity: 0.35;
}

/* Surreal float square */
.surreal-float {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--grid-lines);
    top: 30%;
    right: 20%;
    opacity: 0;
    animation: floatUp 8s ease-in-out infinite;
    z-index: 2;
}

@keyframes floatUp {
    0% { transform: translateY(0) rotate(0deg); opacity: 0.6; }
    50% { transform: translateY(-60px) rotate(15deg); opacity: 0.3; }
    100% { transform: translateY(0) rotate(0deg); opacity: 0.6; }
}

.surreal-float.active {
    opacity: 0.6;
}

/* Inverted hill (surreal) */
.inverted-hill {
    position: absolute;
    top: 40px;
    left: 10%;
    width: 60%;
    height: 120px;
    border-radius: 60% 40% / 70% 30%;
    background: linear-gradient(0deg, rgba(45,55,72,0.1), rgba(45,55,72,0.05));
    transform: scaleY(-1);
    opacity: 0.3;
    z-index: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .scene-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }

    .hill {
        opacity: 0.2;
    }

    .surreal-float {
        display: none;
    }
}

@media (max-width: 480px) {
    #grid-canvas {
        display: none;
    }

    .scene {
        padding: 3rem 1.5rem;
    }

    .hill {
        display: none;
    }

    .inverted-hill {
        display: none;
    }

    .scene-1 .scene-label,
    .scene-5 .scene-label {
        color: var(--accent-warm);
    }
}
