/* ============================================
   parallel.day — Styles
   Neomorphic bento-box, aurora-gradient, minimal
   ============================================ */

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

:root {
    --void-dark: #0A0818;
    --surface-dark: #1A1830;
    --aurora-purple: #6040B0;
    --aurora-teal: #30A890;
    --glitch-pink: #E04878;
    --data-white: #E0E0F0;
    --dim-gray: #484860;
    --bento-gap: 16px;
    --bento-unit: 300px;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void-dark);
    color: var(--data-white);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 0.9vw, 16px);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Aurora Background --- */
#aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
        135deg,
        var(--void-dark) 0%,
        #1A0838 20%,
        var(--aurora-purple) 40%,
        var(--aurora-teal) 60%,
        #1A3030 80%,
        var(--void-dark) 100%
    );
    background-size: 400% 400%;
    animation: auroraShift 20s ease-in-out infinite;
    opacity: 0.12;
}

@keyframes auroraShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 50% 0%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 100%; }
    100% { background-position: 0% 50%; }
}

/* --- Nature Silhouettes --- */
#nature-silhouettes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease;
}

#nature-silhouettes.visible {
    opacity: 1;
}

.nature-leaf {
    position: absolute;
    width: 12px;
    height: 12px;
    opacity: 0.05;
    transition: opacity 0.3s ease;
}

.nature-leaf.hover-near {
    opacity: 0.08;
}

/* --- Glitch Overlay --- */
#glitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
}

#glitch-overlay.glitching {
    animation: glitchFire 100ms steps(3) forwards;
}

@keyframes glitchFire {
    0% {
        opacity: 1;
        background: linear-gradient(
            0deg,
            transparent 0%,
            rgba(96, 64, 176, 0.15) 20%,
            transparent 21%,
            transparent 40%,
            rgba(224, 72, 120, 0.1) 41%,
            transparent 42%,
            transparent 70%,
            rgba(48, 168, 144, 0.12) 71%,
            transparent 72%
        );
        transform: translateX(-2px);
    }
    33% {
        opacity: 1;
        background: linear-gradient(
            0deg,
            transparent 0%,
            rgba(224, 72, 120, 0.15) 50%,
            transparent 51%,
            transparent 80%,
            rgba(96, 64, 176, 0.1) 81%,
            transparent 82%
        );
        transform: translateX(3px);
    }
    66% {
        opacity: 1;
        background: linear-gradient(
            0deg,
            transparent 0%,
            rgba(48, 168, 144, 0.12) 30%,
            transparent 31%,
            transparent 60%,
            rgba(224, 72, 120, 0.08) 61%,
            transparent 62%
        );
        transform: translateX(-1px);
    }
    100% {
        opacity: 0;
        transform: translateX(0);
    }
}

/* --- Glitch Text Effect --- */
.glitch-target {
    position: relative;
}

.glitch-target.glitch-text {
    animation: glitchText 100ms steps(2) forwards;
}

@keyframes glitchText {
    0% {
        text-shadow:
            2px 0 var(--glitch-pink),
            -2px 0 var(--aurora-teal);
        transform: translateX(-2px);
    }
    50% {
        text-shadow:
            -2px 0 var(--glitch-pink),
            2px 0 var(--aurora-purple);
        transform: translateX(2px);
    }
    100% {
        text-shadow: none;
        transform: translateX(0);
    }
}

/* --- Convergence Point (Hero) --- */
.convergence-point {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.convergence-content {
    text-align: center;
    opacity: 0;
    transition: opacity 500ms ease;
}

.convergence-content.visible {
    opacity: 1;
}

#hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(48px, 8vw, 120px);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--data-white);
    line-height: 1;
    margin-bottom: 16px;
}

.convergence-sub {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim-gray);
}

/* --- Data Stream Bands --- */
.data-stream-band {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.stream-svg {
    width: 100%;
    height: 100%;
}

.stream-line {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2s ease;
}

.stream-line.animate {
    stroke-dashoffset: 0;
}

.stream-purple { stroke: var(--aurora-purple); }
.stream-teal { stroke: var(--aurora-teal); }
.stream-pink { stroke: var(--glitch-pink); opacity: 0.6; }

/* --- Bento Grid --- */
.bento-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--bento-gap);
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* --- Bento Box (Neomorphic) --- */
.bento-box {
    position: relative;
    background: var(--surface-dark);
    border-radius: 8px;
    padding: 24px;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.05),
        0 4px 12px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    opacity: 0;
    transition: opacity 200ms ease, box-shadow 300ms ease;
}

.bento-box.visible {
    opacity: 1;
}

.bento-box:hover {
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.07),
        0 6px 16px rgba(0, 0, 0, 0.5);
}

.bento-box:hover .box-aurora-bleed {
    opacity: 0.15;
}

.bento-box:hover .chart-line,
.bento-box:hover .spark-line {
    animation-duration: 1s;
}

/* Box sizes */
.box-1x1 { grid-column: span 1; }
.box-2x1 { grid-column: span 2; }
.box-1x2 { grid-row: span 2; }
.box-2x2 { grid-column: span 2; grid-row: span 2; }

/* Aurora bleed-through per box */
.box-aurora-bleed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.10;
    transition: opacity 300ms ease;
    z-index: 0;
}

#box-streams .box-aurora-bleed {
    background: linear-gradient(135deg, var(--aurora-purple), transparent);
}
#box-threads .box-aurora-bleed {
    background: linear-gradient(135deg, var(--aurora-teal), transparent);
}
#box-latency .box-aurora-bleed {
    background: linear-gradient(135deg, var(--aurora-purple), var(--aurora-teal));
}
#box-about .box-aurora-bleed {
    background: linear-gradient(180deg, var(--aurora-teal), transparent);
}
#box-throughput .box-aurora-bleed {
    background: linear-gradient(135deg, var(--glitch-pink), transparent);
}
#box-sync .box-aurora-bleed {
    background: linear-gradient(135deg, var(--aurora-teal), transparent);
}
#box-convergence-chart .box-aurora-bleed {
    background: linear-gradient(90deg, var(--aurora-purple), var(--aurora-teal));
}
#box-nodes .box-aurora-bleed {
    background: linear-gradient(135deg, var(--aurora-purple), transparent);
}
#box-architecture .box-aurora-bleed {
    background: linear-gradient(135deg, var(--aurora-teal), var(--aurora-purple));
}

/* Box internals */
.box-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim-gray);
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.box-content {
    position: relative;
    z-index: 1;
}

/* Metric styles */
.metric-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-value {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(32px, 3vw, 52px);
    color: var(--data-white);
    line-height: 1;
}

.metric-unit {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim-gray);
}

/* Text content */
.text-content p {
    color: var(--data-white);
    margin-bottom: 12px;
    opacity: 0.85;
}

.text-content p:last-child {
    margin-bottom: 0;
}

/* Chart lines in bento boxes */
.mini-chart,
.convergence-chart {
    width: 100%;
    height: 100px;
}

.chart-line {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s ease;
}

.chart-line.animate {
    stroke-dashoffset: 0;
}

.chart-purple { stroke: var(--aurora-purple); }
.chart-teal { stroke: var(--aurora-teal); }
.chart-pink { stroke: var(--glitch-pink); opacity: 0.6; }

.convergence-dot {
    fill: var(--data-white);
    opacity: 0;
    transition: opacity 0.5s ease 2s;
}

.chart-line.animate ~ .convergence-dot {
    opacity: 1;
}

.chart-annotation {
    display: block;
    text-align: right;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim-gray);
    margin-top: 8px;
}

/* Sparkline */
.sparkline {
    width: 100%;
    height: 40px;
    margin-top: 8px;
}

.spark-line {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1.5s ease;
}

.spark-line.animate {
    stroke-dashoffset: 0;
}

.spark-teal { stroke: var(--aurora-teal); }

/* Status rows */
.status-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.active {
    background: var(--aurora-teal);
    box-shadow: 0 0 6px var(--aurora-teal);
}

.status-dot.pending {
    background: var(--glitch-pink);
    box-shadow: 0 0 6px var(--glitch-pink);
    animation: pulseDot 1.5s ease-in-out infinite;
}

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

.status-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 0.9vw, 16px);
    color: var(--data-white);
    opacity: 0.85;
    flex: 1;
}

.status-val {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim-gray);
}

/* --- Merge Point (Footer) --- */
.merge-point {
    position: relative;
    z-index: 2;
    padding: 80px 24px;
    text-align: center;
    overflow: hidden;
}

.merge-aurora {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        var(--aurora-purple) 0%,
        var(--aurora-teal) 50%,
        var(--aurora-purple) 100%
    );
    background-size: 300% 300%;
    animation: auroraShift 12s ease-in-out infinite;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 0;
}

.merge-point.visible .merge-aurora {
    opacity: 0.15;
}

.merge-content {
    position: relative;
    z-index: 1;
    background: var(--surface-dark);
    border-radius: 8px;
    padding: 48px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.05),
        0 4px 12px rgba(0, 0, 0, 0.4);
}

.merge-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(28px, 3.5vw, 56px);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--data-white);
    margin-bottom: 8px;
}

.merge-sub {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 0.9vw, 16px);
    color: var(--dim-gray);
    margin-bottom: 24px;
}

.merge-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.merge-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--aurora-teal);
    box-shadow: 0 0 8px var(--aurora-teal);
    animation: pulseDot 2s ease-in-out infinite;
}

.merge-label {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--aurora-teal);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .box-2x1 {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .box-2x1 {
        grid-column: span 1;
    }
    .box-1x2 {
        grid-row: span 1;
    }
    .merge-content {
        padding: 32px 24px;
    }
}
