/* chrono.games - Retro-Futuristic Clockwork Temporal Experience */

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

:root {
    --midnight: #0A0E17;
    --gunmetal: #161B2E;
    --phosphor: #00E5CC;
    --brass: #D4A44C;
    --magenta: #E8318A;
    --dial-white: #E8ECF4;
    --patina-gray: #6B7A8E;
    --gold: #F2C94C;
    --scroll-progress: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.15rem);
    line-height: 1.65;
    color: var(--dial-white);
    background: var(--midnight);
    overflow-x: hidden;
}

/* Scan lines */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 1px,
        rgba(0, 0, 0, 0.06) 1px,
        rgba(0, 0, 0, 0.06) 2px
    );
    pointer-events: none;
    z-index: 9999;
}

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

/* Clock-hand progress */
.clock-hand {
    position: fixed;
    left: 3rem;
    top: 50%;
    width: 2px;
    height: 60px;
    background: var(--gold);
    transform-origin: bottom center;
    transform: rotate(calc(var(--scroll-progress) * 360deg));
    z-index: 100;
    border-radius: 1px;
    box-shadow: 0 0 6px rgba(242, 201, 76, 0.4);
}

.clock-hand::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
}

/* VFD text style */
.vfd-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.75rem, 1vw, 1rem);
    letter-spacing: 0.12em;
    color: var(--phosphor);
    text-shadow:
        0 0 4px rgba(0, 229, 204, 0.8),
        0 0 12px rgba(0, 229, 204, 0.4),
        0 0 24px rgba(0, 229, 204, 0.2);
    animation: vfdFlicker 0.5s ease-in-out infinite alternate;
}

@keyframes vfdFlicker {
    0% { text-shadow: 0 0 4px rgba(0,229,204,0.8), 0 0 12px rgba(0,229,204,0.4), 0 0 24px rgba(0,229,204,0.2); }
    100% { text-shadow: 0 0 4px rgba(0,229,204,0.7), 0 0 10px rgba(0,229,204,0.3), 0 0 20px rgba(0,229,204,0.15); }
}

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

.clock-face {
    position: relative;
    width: min(80vw, 80vh);
    height: min(80vw, 80vh);
    border: 1.5px solid var(--brass);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.clock-face::before {
    content: '';
    position: absolute;
    width: calc(100% + 30px);
    height: calc(100% + 30px);
    border: 1px solid rgba(212, 164, 76, 0.2);
    border-radius: 50%;
}

.hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 8vw, 10rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--dial-white);
    text-transform: uppercase;
    line-height: 1;
}

.hero-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1rem, 2vw, 1.8rem);
    color: var(--phosphor);
    letter-spacing: 0.12em;
    text-shadow: 0 0 8px rgba(0, 229, 204, 0.5);
}

.clock-marker {
    position: absolute;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.2rem;
    color: var(--brass);
    letter-spacing: 0.08em;
}

.m3 { right: 1.5rem; top: 50%; transform: translateY(-50%); }
.m6 { bottom: 1.5rem; left: 50%; transform: translateX(-50%); }
.m9 { left: 1.5rem; top: 50%; transform: translateY(-50%); }

.hero-timestamp {
    margin-top: 2rem;
}

/* Segments */
.segment {
    min-height: 100svh;
    display: flex;
    position: relative;
    border-bottom: 1px solid rgba(212, 164, 76, 0.1);
    background: var(--midnight);
    transition: background-color 0.6s ease;
}

.future-segment {
    background: var(--gunmetal);
}

.segment-num-col {
    width: 38%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.segment-num {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(20vw, 30vw, 40vw);
    font-weight: 400;
    color: var(--dial-white);
    opacity: 0.04;
    line-height: 1;
    user-select: none;
}

.segment-content-col {
    width: 62%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 4rem 4rem 2rem;
    opacity: 0;
    filter: blur(3px);
    transform: scale(0.92);
    transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
                filter 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.segment-content-col.focused {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
}

.segment-timestamp {
    display: block;
    margin-bottom: 1.5rem;
    min-height: 1.5em;
}

.segment-content-col h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 8vw, 10rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 0.92;
    margin-bottom: 1.5rem;
    color: var(--dial-white);
}

.segment:nth-child(odd) .segment-content-col h2 {
    color: var(--brass);
}

.future-segment .segment-content-col h2 {
    color: var(--phosphor);
}

.segment-content-col p {
    max-width: 500px;
    color: var(--dial-white);
    opacity: 0.85;
    margin-bottom: 1rem;
}

.contact-line {
    font-family: 'Share Tech Mono', monospace;
    color: var(--phosphor);
    letter-spacing: 0.12em;
    margin-top: 2rem;
    font-size: 1.1rem;
    text-shadow: 0 0 8px rgba(0, 229, 204, 0.4);
}

/* Gear divider */
.gear-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 2rem 0;
    position: relative;
}

.gear-svg {
    opacity: 0.2;
}

.gear-left {
    width: 120px;
    height: 120px;
    animation: gearSpin 60s linear infinite;
}

.gear-right {
    width: 72px;
    height: 72px;
    margin-left: -8px;
    animation: gearSpin 36s linear infinite reverse;
}

@keyframes gearSpin {
    to { transform: rotate(360deg); }
}

.gear-svg:hover {
    animation-duration: 4s;
}

/* Typewriter cursor */
.typewriter-cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.1em;
    background: var(--phosphor);
    vertical-align: text-bottom;
    animation: cursorBlink 0.8s step-end infinite;
}

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

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

    .segment-content-col {
        opacity: 1;
        filter: none;
        transform: none;
    }

    #particleCanvas {
        display: none;
    }
}

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

    .segment-num-col {
        width: 100%;
        height: 20vh;
    }

    .segment-content-col {
        width: 100%;
        padding: 2rem;
    }

    .clock-hand {
        left: 1rem;
    }
}
