/* ============================================
   MUJUN.XYZ - Retro-Futuristic System Interface
   Ethereal Blue Monocolor System
   ============================================ */

/* CSS Custom Properties */
:root {
    --primary-blue: #5BA3E5;
    --blue-light: #7BB8FF;
    --blue-dark: #2E5F99;
    --bg-primary: #F0F3F7;
    --bg-secondary: #E8EBEF;
    --text-primary: #1A1A1A;
    --text-muted: #6B7280;
    --accent-amber: #FFB84D;
    --accent-silver: #D4D4D4;
    --border-blue: #4A90E2;
    --blue-glow: #6BA3FF;
    --night-blue: #1A3A52;

    --font-display: 'IBM Plex Sans', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --font-body: 'IBM Plex Sans', sans-serif;
    --font-data: 'IBM Plex Mono', monospace;

    --corner-size: 6px;
    --block-padding: 30px;
    --block-gap: 16px;
    --header-height: 60px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    animation: bgBreath 6000ms ease-in-out infinite alternate;
}

@keyframes bgBreath {
    0% { background-color: var(--bg-secondary); }
    100% { background-color: var(--bg-primary); }
}

/* Grid Reference Background */
#grid-reference {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.05;
    background-image:
        repeating-linear-gradient(
            0deg,
            var(--accent-silver) 0px,
            var(--accent-silver) 1px,
            transparent 1px,
            transparent 80px
        ),
        repeating-linear-gradient(
            90deg,
            var(--accent-silver) 0px,
            var(--accent-silver) 1px,
            transparent 1px,
            transparent 80px
        );
}

/* Floating Data Points */
#data-points-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.data-point {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--primary-blue);
    border-radius: 50%;
    opacity: 0.03;
    animation: drift linear infinite;
}

@keyframes drift {
    0% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-25vh) translateX(10px); }
    50% { transform: translateY(-50vh) translateX(-5px); }
    75% { transform: translateY(-75vh) translateX(8px); }
    100% { transform: translateY(-100vh) translateX(0); }
}

/* ============================================
   HEADER: Fixed System Shelf
   ============================================ */

#system-shelf {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    background: linear-gradient(180deg, var(--night-blue) 0%, var(--blue-dark) 60%, rgba(46, 95, 153, 0) 100%);
    backdrop-filter: blur(8px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo-bracket {
    font-family: var(--font-data);
    font-size: 18px;
    color: var(--primary-blue);
    opacity: 0.7;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #ffffff;
    text-transform: uppercase;
    font-variant: small-caps;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    position: relative;
    padding: 4px 0;
    transition: color 300ms ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    right: 50%;
    height: 1px;
    background: var(--primary-blue);
    transition: left 300ms ease, right 300ms ease;
}

.nav-link:hover {
    color: #ffffff;
}

.nav-link:hover::after {
    left: 0;
    right: 0;
}

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

.status-indicator {
    width: 6px;
    height: 6px;
    background: var(--accent-amber);
    border-radius: 50%;
    animation: pulse 2000ms ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--accent-amber); }
    50% { opacity: 0.5; box-shadow: 0 0 8px var(--accent-amber); }
}

.status-text {
    font-family: var(--font-data);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--accent-amber);
    text-transform: uppercase;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

#content {
    position: relative;
    z-index: 1;
    padding-top: calc(var(--header-height) + 40px);
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 40px;
    padding-right: 40px;
    padding-bottom: 60px;
}

/* ============================================
   BLOCKS: Modular System
   ============================================ */

.block {
    position: relative;
    background: rgba(240, 243, 247, 0.85);
    padding: 0;
    opacity: 0;
    transition: opacity 800ms cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.block[data-direction="left"] {
    transform: translateX(-40px) scale(0.92);
}

.block[data-direction="right"] {
    transform: translateX(40px) scale(0.92);
}

.block.visible {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.block:hover .block-border {
    box-shadow: 0 0 12px rgba(74, 144, 226, 0.3), 0 0 24px rgba(107, 163, 255, 0.1);
    outline-color: var(--blue-glow);
}

.block:hover .corner-accent {
    transform: rotate(0.5deg);
}

/* Block Border Treatment */
.block-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    outline: 2px solid var(--border-blue);
    pointer-events: none;
    z-index: 2;
    transition: box-shadow 300ms ease;
}

/* Corner Accents */
.corner-accent {
    position: absolute;
    width: var(--corner-size);
    height: var(--corner-size);
    transition: transform 300ms ease;
}

.corner-tl {
    top: -1px;
    left: -1px;
    border-top: 2px solid var(--border-blue);
    border-left: 2px solid var(--border-blue);
}

.corner-tr {
    top: -1px;
    right: -1px;
    border-top: 2px solid var(--border-blue);
    border-right: 2px solid var(--border-blue);
}

.corner-bl {
    bottom: -1px;
    left: -1px;
    border-bottom: 2px solid var(--border-blue);
    border-left: 2px solid var(--border-blue);
}

.corner-br {
    bottom: -1px;
    right: -1px;
    border-bottom: 2px solid var(--border-blue);
    border-right: 2px solid var(--border-blue);
}

.block-content {
    position: relative;
    z-index: 1;
    padding: var(--block-padding);
}

.block-label {
    font-family: var(--font-data);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
    margin-bottom: 12px;
}

.block-title {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.2;
}

.block-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 400ms ease, transform 400ms ease;
}

.block-title .char.space {
    width: 0.3em;
}

.block-title.animated .char {
    opacity: 1;
    transform: translateY(0);
}

.block-text {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    text-align: left;
    margin-bottom: 20px;
}

.block-text-sm {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-muted);
    text-align: left;
    margin-top: 12px;
}

/* ============================================
   BLOCK GRID LAYOUT
   ============================================ */

.block-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--block-gap);
    margin-top: 40px;
}

.block-2x1 {
    grid-column: span 2;
}

.block-1x1 {
    grid-column: span 1;
}

.block-1x2 {
    grid-column: span 1;
}

.block-2x2 {
    grid-column: span 2;
}

.block-full {
    grid-column: span 4;
}

.block-tall {
    min-height: 380px;
}

.circuit-divider {
    grid-column: span 4;
    padding: 20px 0;
    opacity: 0;
    transition: opacity 800ms ease;
}

.circuit-divider.visible {
    opacity: 1;
}

/* ============================================
   HERO BLOCK
   ============================================ */

.block-hero {
    padding: 0;
    background: linear-gradient(135deg, var(--night-blue) 0%, var(--blue-dark) 100%);
    min-height: 340px;
}

.block-hero .block-content {
    padding: 60px 50px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: #ffffff;
    margin-bottom: 16px;
    line-height: 1.1;
}

.hero-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 400ms ease, transform 400ms ease;
}

.hero-title .char.space {
    width: 0.3em;
}

.hero-title.animated .char {
    opacity: 1;
    transform: translateY(0);
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    max-width: 720px;
    margin-bottom: 30px;
}

.hero-circuit {
    margin: 30px 0;
    overflow: hidden;
}

.circuit-svg {
    width: 100%;
    height: 80px;
}

.circuit-path {
    stroke: var(--primary-blue);
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 1200ms ease;
}

.block-hero.visible .circuit-path,
.circuit-divider.visible .circuit-path {
    stroke-dashoffset: 0;
}

.circuit-node {
    fill: var(--primary-blue);
    opacity: 0;
    transition: opacity 600ms ease;
}

.block-hero.visible .circuit-node,
.circuit-divider.visible .circuit-node {
    opacity: 1;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.meta-item {
    font-family: var(--font-data);
    font-size: 12px;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.meta-label {
    color: var(--primary-blue);
    margin-right: 6px;
}

.meta-divider {
    font-family: var(--font-data);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.2);
}

/* ============================================
   NETWORK VISUALIZATIONS
   ============================================ */

.network-svg,
.rings-svg,
.topology-svg,
.netvis-svg {
    width: 100%;
    height: auto;
    display: block;
}

.network-svg line,
.topology-svg .topo-line {
    stroke: var(--primary-blue);
    opacity: 0.5;
}

.node-primary {
    fill: var(--primary-blue);
}

.node-secondary {
    fill: var(--blue-dark);
    stroke: var(--primary-blue);
    stroke-width: 1;
}

/* Concentric Rings */
.concentric-rings {
    padding: 10px 20px;
}

.ring {
    stroke: var(--primary-blue);
    opacity: 0.4;
}

.ring-1 { opacity: 0.2; }
.ring-2 { opacity: 0.35; }
.ring-3 { opacity: 0.5; }
.ring-4 { opacity: 0.7; stroke: var(--border-blue); }

.ring-center {
    fill: var(--accent-amber);
}

/* Topology */
.topology-grid {
    padding: 10px 20px;
}

.topo-node {
    fill: var(--blue-dark);
    stroke: var(--primary-blue);
    stroke-width: 1;
}

.topo-active {
    fill: var(--accent-amber);
    stroke: var(--accent-amber);
}

.topo-line {
    stroke: var(--primary-blue);
    stroke-width: 1;
    opacity: 0.4;
}

/* Network Hub Visualization */
.network-visualization {
    padding: 20px;
}

.hub-node {
    fill: var(--accent-amber);
    stroke: var(--accent-amber);
    stroke-width: 2;
    opacity: 0.9;
}

.outer-node {
    fill: var(--blue-dark);
    stroke: var(--primary-blue);
    stroke-width: 1.5;
}

.mid-node {
    fill: var(--primary-blue);
    stroke: none;
    opacity: 0.7;
}

.hub-line {
    stroke: var(--primary-blue);
    stroke-width: 1.5;
    opacity: 0.5;
}

.outer-line {
    stroke: var(--primary-blue);
    stroke-width: 1;
    opacity: 0.3;
}

.cross-line {
    stroke: var(--blue-light);
    stroke-width: 0.5;
    opacity: 0.2;
    stroke-dasharray: 4 4;
}

/* ============================================
   STAT DISPLAY
   ============================================ */

.stat-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin: 20px 0;
}

.stat-number {
    font-family: var(--font-data);
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-blue);
    letter-spacing: -0.02em;
}

.stat-unit {
    font-family: var(--font-data);
    font-size: 24px;
    color: var(--blue-dark);
}

/* Data Bars */
.data-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
}

.data-bar {
    position: relative;
    height: 28px;
    background: rgba(74, 144, 226, 0.08);
    overflow: hidden;
}

.data-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--blue-dark) 0%, var(--primary-blue) 100%);
    opacity: 0.6;
    transition: width 1200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.data-bar-label {
    position: relative;
    z-index: 1;
    font-family: var(--font-data);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--text-primary);
    text-transform: uppercase;
    line-height: 28px;
    padding-left: 8px;
}

/* ============================================
   PROCESS STEPS
   ============================================ */

.process-steps {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 24px;
}

.process-step {
    display: grid;
    grid-template-columns: 40px 140px 1fr;
    gap: 12px;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid rgba(74, 144, 226, 0.15);
}

.step-number {
    font-family: var(--font-data);
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-blue);
}

.step-label {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--text-primary);
    text-transform: uppercase;
    font-weight: 700;
}

.step-desc {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ============================================
   BLOCK CONTENT SPLIT
   ============================================ */

.block-content-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.split-left {
    padding-right: 20px;
}

/* Network Stats */
.network-stats {
    display: flex;
    gap: 30px;
    margin-top: 24px;
}

.net-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.net-stat-value {
    font-family: var(--font-data);
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-blue);
    letter-spacing: -0.01em;
}

.net-stat-label {
    font-family: var(--font-data);
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ============================================
   MODULE LIST
   ============================================ */

.module-list {
    list-style: none;
    margin-top: 16px;
}

.module-item {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    padding: 10px 0;
    border-bottom: 1px solid rgba(74, 144, 226, 0.12);
    display: flex;
    align-items: center;
    gap: 10px;
}

.module-dot {
    width: 6px;
    height: 6px;
    background: var(--primary-blue);
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================
   SIGNAL CANVAS
   ============================================ */

.signal-wave {
    margin: 20px 0 16px;
    background: rgba(26, 58, 82, 0.06);
    padding: 10px;
}

#signal-canvas {
    width: 100%;
    height: 150px;
    display: block;
}

.signal-readout {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.readout-item {
    font-family: var(--font-data);
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.readout-label {
    color: var(--primary-blue);
    margin-right: 6px;
}

.readout-value {
    color: var(--text-primary);
}

/* ============================================
   SYSTEM LOG
   ============================================ */

.log-entries {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    max-height: 280px;
    overflow: hidden;
}

.log-entry {
    font-family: var(--font-data);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 6px 8px;
    background: rgba(74, 144, 226, 0.04);
    display: flex;
    gap: 12px;
}

.log-time {
    color: var(--primary-blue);
    flex-shrink: 0;
    width: 60px;
}

.log-msg {
    color: var(--text-primary);
}

/* ============================================
   CTA BLOCK
   ============================================ */

.block-cta {
    background: linear-gradient(135deg, var(--night-blue) 0%, var(--blue-dark) 100%);
    text-align: left;
}

.cta-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: #ffffff;
    margin-bottom: 12px;
}

.cta-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 400ms ease, transform 400ms ease;
}

.cta-title .char.space {
    width: 0.3em;
}

.cta-title.animated .char {
    opacity: 1;
    transform: translateY(0);
}

.cta-text {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 28px;
    max-width: 560px;
}

.cta-button {
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.08em;
    color: var(--accent-amber);
    background: transparent;
    border: 2px solid var(--accent-amber);
    padding: 14px 32px;
    cursor: pointer;
    transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cta-button:hover {
    transform: scale(1.02);
    box-shadow: 0 0 16px rgba(255, 184, 77, 0.3);
    background: rgba(255, 184, 77, 0.08);
}

.cta-btn-bracket {
    font-weight: 700;
    opacity: 0.6;
}

/* ============================================
   FOOTER
   ============================================ */

#system-footer {
    position: relative;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--blue-dark) 40%, var(--night-blue) 100%);
    padding: 60px 40px 30px;
    overflow: hidden;
}

.footer-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(91, 163, 229, 0.03) 2px,
        rgba(91, 163, 229, 0.03) 4px
    );
    animation: scanScroll 8000ms linear infinite;
}

@keyframes scanScroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.footer-circuit {
    margin-bottom: 20px;
}

.footer-circuit-svg {
    width: 100%;
    height: 30px;
}

.footer-circuit-svg .circuit-path {
    stroke: var(--primary-blue);
    opacity: 0.3;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
}

.footer-meta {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.footer-item {
    font-family: var(--font-data);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

/* ============================================
   DIVIDER SVG
   ============================================ */

.divider-svg {
    width: 100%;
    height: 40px;
}

.divider-path {
    stroke: var(--border-blue);
    opacity: 0.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .block-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .block-2x1 { grid-column: span 2; }
    .block-1x1 { grid-column: span 1; }
    .block-1x2 { grid-column: span 1; }
    .block-2x2 { grid-column: span 2; }
    .block-full { grid-column: span 2; }
    .circuit-divider { grid-column: span 2; }

    .block-content-split {
        grid-template-columns: 1fr;
    }

    .process-step {
        grid-template-columns: 40px 1fr;
    }

    .step-desc {
        grid-column: span 2;
        padding-left: 52px;
    }
}

@media (max-width: 640px) {
    :root {
        --block-padding: 20px;
    }

    .block-grid {
        grid-template-columns: 1fr;
    }

    .block-2x1,
    .block-1x1,
    .block-1x2,
    .block-2x2,
    .block-full,
    .circuit-divider {
        grid-column: span 1;
    }

    #content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .header-inner {
        padding: 0 16px;
    }

    .nav-links {
        display: none;
    }

    .hero-meta {
        flex-direction: column;
        gap: 8px;
    }

    .meta-divider {
        display: none;
    }

    .network-stats {
        flex-direction: column;
        gap: 16px;
    }

    .signal-readout {
        flex-direction: column;
        gap: 8px;
    }

    .footer-meta {
        flex-direction: column;
        gap: 8px;
    }

    .process-step {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .step-desc {
        grid-column: span 1;
        padding-left: 0;
    }
}
