/* ============================================================
   chrono.games -- Time Machine Cockpit
   Colors: #0D0D12 #12131A #C9A84C #39FF85 #2E2B5F #D4D4D8 #8B7D6B #FF9F1C
   Fonts: Orbitron, Space Grotesk, Share Tech Mono, Cinzel
   ============================================================ */

:root {
    --void: #0D0D12;
    --instrument: #12131A;
    --brass: #C9A84C;
    --phosphor: #39FF85;
    --indigo: #2E2B5F;
    --silver: #D4D4D8;
    --copper: #8B7D6B;
    --amber: #FF9F1C;
}

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    background: var(--void);
    color: var(--silver);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ===== Chronometer Hero ===== */
#chronometer-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    position: relative;
    background: var(--void);
}

#chrono-svg {
    width: min(80vw, 500px);
    height: min(80vw, 500px);
}

.ring-1 { animation: rotateRing 120s linear infinite; transform-origin: 300px 300px; }
.ring-2 { animation: rotateRing 80s linear infinite reverse; transform-origin: 300px 300px; }
.ring-3 { animation: rotateRing 200s linear infinite; transform-origin: 300px 300px; }
.ring-3-text { animation: rotateRing 200s linear infinite; transform-origin: 300px 300px; }
.portal-glow { animation: pulseGlow 3s ease-in-out infinite; }

@keyframes rotateRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.25; }
}

.chrono-name {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 22px;
    fill: var(--brass);
    letter-spacing: 0.08em;
}

.era-label {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 11px;
    fill: var(--copper);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.portal-center {
    filter: drop-shadow(0 0 20px rgba(57,255,133,0.2)) drop-shadow(0 0 60px rgba(57,255,133,0.1));
}

#hero-tagline {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    color: var(--copper);
    margin-top: 32px;
    opacity: 0;
    transition: opacity 1s ease;
    letter-spacing: 0.04em;
}

#hero-tagline.visible {
    opacity: 1;
}

/* ===== Temporal Dashboard ===== */
#temporal-dashboard {
    padding: 80px 24px;
    scroll-snap-align: start;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    max-width: 960px;
    margin: 0 auto;
}

.instrument-module {
    background: var(--instrument);
    border: 1px solid rgba(201, 168, 76, 0.3);
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.instrument-module:hover {
    border-color: var(--brass);
}

.instrument-module:hover .module-content::before {
    opacity: 0.08;
}

.module-label-bar {
    height: 8px;
    background: var(--brass);
}

.module-content {
    padding: 24px 20px;
    position: relative;
}

.module-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-conic-gradient(
        var(--instrument) 0deg, var(--instrument) 7.5deg,
        rgba(22, 23, 32, 0.5) 7.5deg, rgba(22, 23, 32, 0.5) 15deg
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.module-era {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(16px, 2vw, 22px);
    color: var(--brass);
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.module-desc {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--copper);
    margin-bottom: 16px;
    line-height: 1.5;
}

.nixie-counter {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.nixie-digit {
    display: inline-block;
    width: 28px;
    height: 40px;
    background: var(--void);
    box-shadow: inset 0 0 8px rgba(57, 255, 133, 0.15);
    text-align: center;
    line-height: 40px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 28px;
    color: var(--phosphor);
    border-radius: 2px;
}

.module-status {
    padding: 8px 20px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: var(--copper);
    letter-spacing: 0.12em;
    border-top: 1px solid rgba(201, 168, 76, 0.15);
}

/* ===== Timeline Spine ===== */
#timeline-spine {
    position: relative;
    padding: 100px 24px;
    min-height: 100vh;
    scroll-snap-align: start;
}

.spine-line {
    position: absolute;
    left: 50%;
    top: 0;
    width: 20px;
    height: 100%;
    transform: translateX(-50%);
    z-index: 1;
}

#spine-line-draw {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 0.1s linear;
}

.timeline-entries {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

.timeline-entry {
    position: relative;
    padding: 40px 0;
    display: flex;
    align-items: flex-start;
}

.entry-left {
    justify-content: flex-start;
    padding-right: 55%;
}

.entry-right {
    justify-content: flex-end;
    padding-left: 55%;
}

.entry-diamond {
    position: absolute;
    left: 50%;
    top: 50px;
    width: 8px;
    height: 8px;
    background: var(--brass);
    transform: translateX(-50%) rotate(45deg) scale(0);
    z-index: 3;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.entry-diamond.visible {
    transform: translateX(-50%) rotate(45deg) scale(1);
}

.entry-connector {
    position: absolute;
    top: 54px;
    height: 1px;
    width: 40px;
    background: var(--brass);
    opacity: 0;
    transition: opacity 0.4s ease 0.2s;
}

.entry-left .entry-connector {
    left: calc(50% + 8px);
    transform: scaleX(-1);
    right: auto;
}

.entry-right .entry-connector {
    right: calc(50% + 8px);
    left: auto;
}

.entry-diamond.visible ~ .entry-connector {
    opacity: 0.6;
}

.entry-content {
    background: var(--instrument);
    border: 1px solid rgba(201, 168, 76, 0.2);
    padding: 24px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

.entry-era {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--copper);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.entry-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--brass);
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.entry-desc {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    color: var(--silver);
    line-height: 1.6;
}

/* ===== Departure Lounge ===== */
#departure-lounge {
    padding: 100px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    scroll-snap-align: start;
    background: linear-gradient(to bottom, var(--void), var(--indigo));
}

.terminus-diamond {
    width: 32px;
    height: 32px;
    background: var(--brass);
    transform: rotate(45deg);
    margin-bottom: 60px;
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
}

.departure-circle {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: conic-gradient(var(--brass), var(--phosphor), var(--indigo), var(--amber), var(--brass));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: rotateDeparture 8s linear infinite;
    box-shadow: 0 0 40px rgba(57, 255, 133, 0.2), 0 0 80px rgba(57, 255, 133, 0.1);
    position: relative;
}

@keyframes rotateDeparture {
    from { background: conic-gradient(from 0deg, var(--brass), var(--phosphor), var(--indigo), var(--amber), var(--brass)); }
    to { background: conic-gradient(from 360deg, var(--brass), var(--phosphor), var(--indigo), var(--amber), var(--brass)); }
}

.departure-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.06em;
    color: white;
    text-align: center;
    mix-blend-mode: difference;
    padding: 20px;
}

.satellite-gauges {
    display: flex;
    gap: 32px;
    margin-top: 60px;
    flex-wrap: wrap;
    justify-content: center;
}

.gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.gauge-ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid rgba(201, 168, 76, 0.4);
    position: relative;
}

.gauge-ring::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 20px;
    background: var(--brass);
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(45deg);
}

.gauge-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--copper);
    letter-spacing: 0.04em;
}

.gauge-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    color: var(--amber);
    letter-spacing: 0.12em;
}

.gauge-green {
    color: var(--phosphor);
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 0 8px;
    }

    .timeline-entry {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .entry-left, .entry-right {
        justify-content: center;
        padding: 20px 0;
    }

    .entry-diamond {
        display: none;
    }

    .entry-connector {
        display: none;
    }

    .spine-line {
        display: none;
    }

    .satellite-gauges {
        gap: 20px;
    }

    .departure-circle {
        width: 180px;
        height: 180px;
    }

    .departure-text {
        font-size: 13px;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .ring-1, .ring-2, .ring-3, .ring-3-text {
        animation: none;
    }

    .portal-glow {
        animation: none;
        opacity: 0.2;
    }

    .departure-circle {
        animation: none;
    }

    .entry-diamond {
        transform: translateX(-50%) rotate(45deg) scale(1);
        transition: none;
    }

    .entry-content {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
