/* mosoon.xyz - Abstract glitch art dopamine neon data */
/* Colors: #0A0A0A #39FF14 #FF00FF #00FFFF #FF3366 #E0E0E0 #1A1A1A #2A2A2A */

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

body {
    background-color: #0A0A0A;
    color: #E0E0E0;
    font-family: 'Rubik', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background hex grid pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.3;
    background-image:
        linear-gradient(60deg, #1A1A1A 25%, transparent 25%),
        linear-gradient(-60deg, #1A1A1A 25%, transparent 25%),
        linear-gradient(60deg, transparent 75%, #1A1A1A 75%),
        linear-gradient(-60deg, transparent 75%, #1A1A1A 75%);
    background-size: 60px 104px;
    background-position: 0 0, 0 0, 30px 52px, 30px 52px;
}

/* Scanline */
.scanline {
    position: fixed;
    top: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: rgba(57, 255, 20, 0.1);
    z-index: 1000;
    animation: scanSweep 3s linear infinite;
    pointer-events: none;
}

@keyframes scanSweep {
    0% { top: -2px; }
    100% { top: 100vh; }
}

/* Hero Section */
.hero-hex {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.hero-cell {
    width: 320px;
    height: 360px;
}

/* Hex cell shape */
.hex-cell,
.hex-frame {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background-color: #1A1A1A;
    position: relative;
    transition: background-color 150ms ease;
}

.hex-cell::before {
    content: '';
    position: absolute;
    inset: 2px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background-color: #0A0A0A;
    z-index: 0;
}

.hex-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 30px 20px;
    text-align: center;
}

/* Hero title with chromatic aberration */
.hero-title {
    position: relative;
    font-family: 'Major Mono Display', monospace;
    font-size: 36px;
    font-weight: 400;
    margin-bottom: 16px;
}

.glitch-layer {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.glitch-green {
    color: #39FF14;
    opacity: 0.5;
    transform: translate(-2px, -1px);
    animation: glitchConverge 600ms ease-out forwards;
}

.glitch-magenta {
    color: #FF00FF;
    opacity: 0.5;
    transform: translate(2px, 1px);
    animation: glitchConverge 600ms ease-out 100ms forwards;
}

.glitch-cyan {
    color: #00FFFF;
    opacity: 0.5;
    transform: translate(1px, -2px);
    animation: glitchConverge 600ms ease-out 200ms forwards;
}

.glitch-main {
    position: relative;
    color: #39FF14;
}

@keyframes glitchConverge {
    0% { opacity: 0.5; }
    100% { transform: translate(0, 0); opacity: 0; }
}

/* Hero data readout */
.hero-data {
    font-family: 'Victor Mono', monospace;
    font-size: 14px;
    color: #FF00FF;
}

/* Navigation Row */
.nav-row {
    justify-content: center;
    position: relative;
    z-index: 2;
    margin-top: -40px;
}

.nav-cell {
    cursor: pointer;
    width: 140px;
    height: 158px;
}

.nav-cell.active {
    background-color: #2A2A2A;
}

.nav-cell.active::after {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 2px solid #39FF14;
    pointer-events: none;
    animation: pulseBorder 2s ease-in-out infinite;
}

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

.nav-label {
    font-family: 'Major Mono Display', monospace;
    font-size: 12px;
    color: #39FF14;
    text-transform: uppercase;
}

/* Hex Row Layout */
.hex-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    margin-top: -30px;
}

.hex-row:first-child {
    margin-top: 0;
}

.hex-row-offset {
    margin-left: 94px;
}

/* Data cells */
.data-cell {
    width: 180px;
    height: 202px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 400ms ease, transform 400ms ease;
}

.data-cell.visible {
    opacity: 1;
    transform: scale(1);
}

.data-cell:hover {
    background-color: #2A2A2A;
}

.cell-label {
    font-family: 'Major Mono Display', monospace;
    font-size: 11px;
    color: #39FF14;
    text-transform: uppercase;
    margin-bottom: 4px;
    display: block;
}

.cell-value {
    font-family: 'Victor Mono', monospace;
    font-size: 28px;
    color: #FF00FF;
    display: block;
    margin-bottom: 2px;
}

.cell-unit {
    font-family: 'Rubik', sans-serif;
    font-size: 11px;
    color: #E0E0E0;
    display: block;
    margin-bottom: 8px;
    opacity: 0.6;
}

/* Sparklines */
.sparkline {
    width: 80px;
    height: 24px;
}

.sparkline svg {
    width: 100%;
    height: 100%;
}

.spark-path {
    fill: none;
    stroke: #FF00FF;
    stroke-width: 2;
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
}

.spark-path.spark-cyan {
    stroke: #00FFFF;
}

.data-cell.visible .spark-path {
    animation: drawSpark 1.5s ease forwards;
}

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

/* Bar charts */
.bar-chart {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 30px;
    width: 60px;
}

.bar {
    flex: 1;
    background-color: #FF00FF;
    height: 0;
    transition: height 1s ease;
}

.bar-cyan {
    background-color: #00FFFF;
}

.bar-pink {
    background-color: #FF3366;
}

.data-cell.visible .bar {
    height: var(--height);
}

/* Glitch effect class (applied by JS) */
.glitching {
    animation: glitchJitter 150ms steps(2) forwards;
}

@keyframes glitchJitter {
    0% { clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); }
    25% { clip-path: polygon(48% 2%, 102% 23%, 98% 77%, 52% 98%, 2% 77%, -2% 23%); }
    50% { clip-path: polygon(51% -1%, 99% 26%, 101% 74%, 49% 101%, -1% 74%, 1% 26%); }
    75% { clip-path: polygon(50% 1%, 100% 24%, 100% 76%, 50% 99%, 0% 76%, 0% 24%); }
    100% { clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%); }
}

/* Responsive */
@media (max-width: 768px) {
    .hex-row {
        flex-direction: column;
        align-items: center;
        gap: 16px;
        margin-top: 16px;
    }

    .hex-row-offset {
        margin-left: 0;
    }

    .data-cell,
    .nav-cell {
        clip-path: none;
        border-radius: 12px;
        width: 90%;
        max-width: 300px;
        height: auto;
        min-height: 160px;
    }

    .data-cell::before,
    .nav-cell::before {
        clip-path: none;
        border-radius: 12px;
    }

    .hero-cell {
        width: 260px;
        height: 300px;
    }

    .hero-title {
        font-size: 24px;
    }

    .nav-row {
        margin-top: 16px;
    }
}
