/* chloengine.com - Mid-Century Kinetic Mechanical Engine */

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

:root {
    --burgundy: #6B1D2A;
    --cream: #F5F0E8;
    --graphite: #2C2A28;
    --copper: #B87333;
    --gold: #C9A84C;
    --oil-black: #1A1714;
    --patina: #5E8C6A;
    --blueprint: #4A6FA5;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: var(--graphite);
    background: var(--cream);
    overflow-x: hidden;
}

/* Leather strip */
.leather-strip {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: repeating-linear-gradient(
        135deg,
        var(--burgundy) 0px,
        var(--burgundy) 4px,
        #5A1824 4px,
        #5A1824 8px
    );
    z-index: 200;
}

/* Nav gear */
.nav-gear {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 150;
    cursor: pointer;
}

.gear-icon {
    width: 40px;
    height: 40px;
    transition: transform 0.4s ease-in-out;
}

.nav-gear:hover .gear-icon {
    transform: rotate(45deg);
}

.nav-radial {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.nav-gear:hover .nav-radial {
    opacity: 1;
    pointer-events: auto;
}

.nav-item {
    position: absolute;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-60px) rotate(calc(-1 * var(--angle)));
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--copper);
    text-decoration: none;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 0.2s;
}

.nav-item:hover {
    color: var(--gold);
}

/* Gear system */
.gear-system {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.deco-gear {
    position: absolute;
    opacity: 0.12;
}

.gear-large {
    width: 20vw;
    height: 20vw;
    top: 60%;
    right: -5vw;
}

.gear-small {
    width: 8vw;
    height: 8vw;
    top: calc(60% - 2vw);
    right: calc(15vw - 5vw + 1vw);
}

/* Blueprint grid background */
.blueprint-bg {
    background:
        repeating-linear-gradient(
            0deg,
            rgba(74, 111, 165, 0.08) 0px,
            transparent 1px,
            transparent 40px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(74, 111, 165, 0.08) 0px,
            transparent 1px,
            transparent 40px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(74, 111, 165, 0.15) 0px,
            transparent 1px,
            transparent 200px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(74, 111, 165, 0.15) 0px,
            transparent 1px,
            transparent 200px
        );
}

/* Hero */
.hero {
    height: 100svh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-split {
    display: flex;
    width: 100%;
    height: 100%;
}

.hero-left {
    width: 50%;
    background: var(--burgundy);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-right {
    width: 50%;
    background:
        repeating-linear-gradient(
            0deg,
            rgba(74, 111, 165, 0.08) 0px,
            transparent 1px,
            transparent 40px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(74, 111, 165, 0.08) 0px,
            transparent 1px,
            transparent 40px
        ),
        var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(4rem, 12vw, 14rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    line-height: 0.92;
    color: var(--cream);
    display: flex;
}

.letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: letterArrive 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: calc(var(--delay) * 60ms + 200ms);
}

@keyframes letterArrive {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.engine-word {
    position: relative;
    margin-top: 0.5rem;
    overflow: hidden;
}

.engine-track {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--copper);
    position: absolute;
    top: 50%;
    left: 0;
}

.engine-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.5rem, 4vw, 4rem);
    letter-spacing: 0.15em;
    color: var(--gold);
    opacity: 0;
    transform: translateX(100%);
    animation: engineSlide 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.7s forwards;
}

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

.blueprint-surface {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}

.tagline {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.3vw, 1.3rem);
    color: var(--graphite);
    opacity: 0;
    animation: fadeIn 0.6s ease-in-out 1.5s forwards;
    line-height: 1.65;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.copper-line {
    width: 100%;
    max-width: 400px;
    margin-top: 1rem;
}

.copper-line line {
    animation: drawLine 1.2s ease-in-out 1.3s forwards;
}

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

/* Engine Bay - Horizontal Scroll */
.engine-bay {
    height: 400vh;
    position: relative;
}

.engine-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chassis-rail {
    height: 10vh;
    display: flex;
    align-items: center;
    background: var(--oil-black);
    padding: 0 2rem;
    flex-shrink: 0;
}

.belt-path {
    width: 100%;
    height: 30px;
}

.belt-animate {
    animation: beltMove 3s linear infinite;
}

@keyframes beltMove {
    to { stroke-dashoffset: -24; }
}

.engine-track-inner {
    display: flex;
    flex: 1;
    transition: transform 0.1s linear;
}

.cylinder {
    min-width: 100vw;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(184, 115, 51, 0.15);
}

.cylinder:nth-child(odd) {
    background: var(--cream);
}

.cylinder:nth-child(even) {
    background:
        repeating-linear-gradient(
            0deg,
            rgba(74, 111, 165, 0.06) 0px,
            transparent 1px,
            transparent 40px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(74, 111, 165, 0.06) 0px,
            transparent 1px,
            transparent 40px
        ),
        #F0EBE2;
}

.cylinder-num {
    position: absolute;
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(8rem, 20vw, 20rem);
    color: var(--graphite);
    opacity: 0.06;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
    pointer-events: none;
}

.cylinder-content {
    max-width: 500px;
    padding: 2rem;
    border-left: 3px solid var(--copper);
    position: relative;
    z-index: 2;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.5s cubic-bezier(0.22, 0.61, 0.36, 1), max-height 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.cylinder-content.piston-revealed {
    opacity: 1;
    max-height: 400px;
}

.cylinder-content h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 5vw, 5rem);
    letter-spacing: 0.08em;
    line-height: 0.92;
    color: var(--burgundy);
    margin-bottom: 1rem;
}

.cylinder-content p {
    color: var(--graphite);
    font-weight: 300;
}

/* Dashboard Footer */
.dashboard {
    background: var(--oil-black);
    padding: 4rem 2rem;
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.gauge-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(
        var(--copper) 0deg,
        var(--copper) 0deg,
        rgba(255, 255, 255, 0.05) 0deg,
        rgba(255, 255, 255, 0.05) 360deg
    );
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 1s ease-in-out;
}

.gauge-ring::before {
    content: '';
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--oil-black);
    position: absolute;
}

.gauge-needle {
    position: absolute;
    width: 2px;
    height: 40px;
    background: var(--gold);
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-135deg);
    transition: transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
    border-radius: 1px;
}

.gauge-needle::after {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
    position: absolute;
    bottom: -3px;
    left: -2px;
}

.gauge-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--cream);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.gauge-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.75rem, 1vw, 1rem);
    color: var(--copper);
}

/* Commissioner variable weight hover */
.cylinder-content p:hover {
    font-weight: 500;
    transition: font-weight 0.2s ease;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .letter {
        opacity: 1;
        transform: none;
    }

    .engine-text {
        opacity: 1;
        transform: none;
    }

    .tagline {
        opacity: 1;
    }

    .cylinder-content {
        opacity: 1;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .hero-split {
        flex-direction: column;
    }

    .hero-left,
    .hero-right {
        width: 100%;
        height: 50%;
    }

    .dashboard {
        gap: 2rem;
        padding: 3rem 1rem;
    }

    .gauge-ring {
        width: 100px;
        height: 100px;
    }

    .gauge-ring::before {
        width: 74px;
        height: 74px;
    }
}
