/* simulai.net — distributed simulation network
 * sci-fi / hud-overlay / mysterious-moody
 */

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

:root {
    --void: #060D15;
    --panel: #0B1622;
    --accent-primary: #00D4AA;
    --accent-secondary: #1B8FD4;
    --accent-warning: #D4A017;
    --text-primary: #B8C9D9;
    --text-secondary: #3A6B5C;
    --node-inactive: #1E3044;
    --edge-base: rgba(27, 143, 212, 0.3);
    --edge-glow: rgba(0, 212, 170, 0.15);

    --font-mono: 'Overpass Mono', 'Space Mono', ui-monospace, monospace;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--void);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 400vh;
    font-size: 17px;
    line-height: 1.7;
    letter-spacing: 0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle scanline overlay for HUD feel */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(0, 212, 170, 0.012) 0px,
            rgba(0, 212, 170, 0.012) 1px,
            transparent 1px,
            transparent 3px
        );
    mix-blend-mode: screen;
}

/* Vignette for warm-screen feel */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 49;
    background:
        radial-gradient(
            ellipse at center,
            rgba(6, 13, 21, 0) 40%,
            rgba(6, 13, 21, 0.55) 100%
        );
}

/* Progress bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--accent-primary);
    box-shadow: 0 0 8px rgba(0, 212, 170, 0.6);
    z-index: 100;
    transition: width 80ms linear;
}

/* Network canvas */
.network-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
}

/* Quadrant container */
.quadrants {
    position: relative;
    z-index: 1;
}

.quadrant {
    position: relative;
    height: 100vh;
    min-height: 720px;
    width: 100%;
    padding: 60px 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quadrant-meta-top,
.quadrant-meta-bottom {
    position: absolute;
    left: 60px;
    right: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    pointer-events: none;
}

.quadrant-meta-top { top: 32px; }
.quadrant-meta-bottom { bottom: 32px; }

.meta-label {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.85;
    white-space: nowrap;
}

.quadrant-tag {
    position: absolute;
    bottom: 32px;
    right: 60px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--accent-primary);
    opacity: 0.55;
}

.quadrant-tag--side {
    bottom: auto;
    top: 50%;
    right: 24px;
    transform: rotate(90deg) translateX(50%);
    transform-origin: right center;
}

/* ============ QUADRANT 1: TOPOLOGY ============ */

.quadrant--topology {
    text-align: center;
}

.topology-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0.95;
    transition: opacity 200ms ease;
}

.topology-content:hover { opacity: 1; }

.domain-mark {
    display: inline-block;
}

.domain-title {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: clamp(64px, 9vw, 120px);
    letter-spacing: -0.01em;
    color: var(--text-primary);
    line-height: 1;
    opacity: 0.95;
    text-shadow: 0 0 24px rgba(0, 212, 170, 0.18);
}

.domain-subtitle {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--text-primary);
    opacity: 0.4;
    margin-top: 24px;
}

.quadrant--topology .quadrant-tag {
    bottom: 32px;
    right: 60px;
}

/* ============ QUADRANT 2: ROUTING ============ */

.quadrant--routing {
    align-items: center;
}

.hud-panels {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    position: relative;
    z-index: 2;
}

.hud-panel {
    background: rgba(11, 22, 34, 0.9);
    border: 1px solid rgba(0, 212, 170, 0.4);
    padding: 40px 36px;
    width: 36%;
    max-width: 460px;
    min-width: 320px;
    position: relative;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.hud-panel--left {
    transform: translateX(-80px);
    margin-left: 0;
}

.hud-panel--right {
    transform: translateX(80px);
    margin-left: auto;
}

.hud-panel.is-visible {
    opacity: 0.95;
    transform: translateX(0);
}

.hud-panel:hover {
    opacity: 1;
}

/* Corner accents */
.corner {
    position: absolute;
    background: var(--accent-primary);
    opacity: 0.85;
    transition: width 300ms ease-out 500ms, height 300ms ease-out 500ms;
}

.corner--tl, .corner--tr {
    top: -1px;
    height: 1px;
    width: 0;
}

.corner--bl, .corner--br {
    bottom: -1px;
    height: 1px;
    width: 0;
}

.corner--tl { left: -1px; }
.corner--tr { right: -1px; }
.corner--bl { left: -1px; }
.corner--br { right: -1px; }

.corner::before,
.corner::after {
    content: "";
    position: absolute;
    background: var(--accent-primary);
}

/* vertical leg of each corner */
.corner--tl::before {
    top: 0;
    left: 0;
    width: 1px;
    height: 0;
    transition: height 300ms ease-out 500ms;
}
.corner--tr::before {
    top: 0;
    right: 0;
    width: 1px;
    height: 0;
    transition: height 300ms ease-out 500ms;
}
.corner--bl::before {
    bottom: 0;
    left: 0;
    width: 1px;
    height: 0;
    transition: height 300ms ease-out 500ms;
}
.corner--br::before {
    bottom: 0;
    right: 0;
    width: 1px;
    height: 0;
    transition: height 300ms ease-out 500ms;
}

.is-visible .corner--tl,
.is-visible .corner--tr,
.is-visible .corner--bl,
.is-visible .corner--br {
    width: 12px;
}

.is-visible .corner--tl::before,
.is-visible .corner--tr::before,
.is-visible .corner--bl::before,
.is-visible .corner--br::before {
    height: 12px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(58, 107, 92, 0.6);
    padding-bottom: 14px;
    margin-bottom: 24px;
    opacity: 0;
    transition: opacity 200ms ease 800ms;
}

.is-visible .panel-header { opacity: 1; }

.panel-tag {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-primary);
}

.panel-id {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.panel-title {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: clamp(40px, 4.5vw, 56px);
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 18px;
    opacity: 0;
    transition: opacity 200ms ease 800ms;
}

.is-visible .panel-title { opacity: 0.95; }

.panel-title--lg {
    font-size: clamp(48px, 6vw, 84px);
    margin-bottom: 22px;
}

.panel-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-primary);
    opacity: 0;
    transition: opacity 200ms ease 900ms;
}

.is-visible .panel-body { opacity: 0.85; }

.panel-body--lg {
    font-size: 18px;
    max-width: 720px;
}

.panel-body:hover { opacity: 1 !important; }

.panel-meta {
    list-style: none;
    margin-top: 28px;
    border-top: 1px dashed rgba(58, 107, 92, 0.6);
    padding-top: 20px;
    opacity: 0;
    transition: opacity 200ms ease 1000ms;
}

.is-visible .panel-meta { opacity: 1; }

.panel-meta li {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 6px 0;
}

.meta-key { color: var(--text-secondary); }
.meta-val {
    color: var(--accent-secondary);
    font-weight: 500;
}

/* ============ QUADRANT 3: THROUGHPUT ============ */

.quadrant--throughput {
    align-items: center;
}

.throughput-panel {
    width: 80%;
    max-width: 1100px;
    background: rgba(11, 22, 34, 0.9);
    border: 1px solid rgba(0, 212, 170, 0.4);
    border-radius: 8px;
    padding: 56px 64px;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: inset 0 0 40px rgba(0, 212, 170, 0.05);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.throughput-panel.is-visible {
    opacity: 0.97;
    transform: translateY(0);
}

.throughput-panel .corner--tl,
.throughput-panel .corner--bl { left: -1px; }
.throughput-panel .corner--tr,
.throughput-panel .corner--br { right: -1px; }

.pulse-bar-track {
    width: 100%;
    height: 3px;
    background: rgba(58, 107, 92, 0.25);
    margin-top: 12px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    border-radius: 1px;
}

.pulse-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(
        90deg,
        var(--accent-secondary) 0%,
        var(--accent-primary) 55%,
        var(--accent-warning) 100%
    );
    box-shadow: 0 0 12px rgba(0, 212, 170, 0.4);
    transition: width 2000ms cubic-bezier(0.22, 0.68, 0.18, 1);
    border-radius: 1px;
}

.pulse-readout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    border-top: 1px dashed rgba(58, 107, 92, 0.5);
    border-bottom: 1px dashed rgba(58, 107, 92, 0.5);
    padding: 18px 0;
    margin-bottom: 36px;
}

.readout-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.readout-key {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.readout-val {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.04em;
    color: var(--accent-primary);
    text-shadow: 0 0 10px rgba(0, 212, 170, 0.25);
}

.grid-meta {
    margin-top: 32px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px 28px;
    border-top: 1px dashed rgba(58, 107, 92, 0.5);
    padding-top: 24px;
}

.grid-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.grid-key {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.grid-val {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.04em;
    color: var(--accent-secondary);
}

/* ============ QUADRANT 4: CONVERGENCE ============ */

.quadrant--convergence {
    align-items: center;
    justify-content: center;
}

.convergence-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 640px;
    padding: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms ease 200ms, transform 800ms ease 200ms;
}

.convergence-content.is-visible {
    opacity: 0.97;
    transform: translateY(0);
}

.convergence-mark {
    display: flex;
    flex-direction: column;
    gap: 22px;
    align-items: center;
}

.convergence-label,
.convergence-foot {
    color: var(--accent-primary);
    opacity: 0.6;
}

.convergence-title {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: clamp(56px, 8vw, 110px);
    letter-spacing: -0.01em;
    line-height: 1;
    color: var(--text-primary);
    text-shadow:
        0 0 32px rgba(0, 212, 170, 0.35),
        0 0 60px rgba(0, 212, 170, 0.18);
    opacity: 0.95;
}

.convergence-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.75;
    color: var(--text-primary);
    opacity: 0.85;
    max-width: 540px;
    transition: opacity 200ms ease;
}

.convergence-body:hover { opacity: 1; }

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

@media (max-width: 900px) {
    .quadrant {
        padding: 80px 24px;
        min-height: 100vh;
    }

    .quadrant-meta-top,
    .quadrant-meta-bottom {
        left: 24px;
        right: 24px;
        gap: 16px;
        font-size: 10px;
    }

    .quadrant-meta-top .meta-label:nth-child(2),
    .quadrant-meta-bottom .meta-label:nth-child(2) {
        text-align: right;
    }

    .meta-label {
        font-size: 10px;
        letter-spacing: 0.1em;
    }

    .quadrant-tag {
        right: 24px;
        font-size: 11px;
    }

    .quadrant-tag--side {
        right: 8px;
    }

    .hud-panels {
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        gap: 24px;
        padding: 0 4px;
    }

    .hud-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 28px 24px;
    }

    .hud-panel--left {
        transform: translateY(40px);
    }
    .hud-panel--right {
        transform: translateY(40px);
    }

    .hud-panel.is-visible {
        transform: translateY(0);
    }

    .panel-title {
        font-size: 36px;
    }

    .throughput-panel {
        width: 100%;
        padding: 32px 24px;
    }

    .pulse-readout,
    .grid-meta {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .domain-title {
        font-size: 56px;
    }

    .panel-title--lg {
        font-size: 44px;
    }

    .convergence-title {
        font-size: 56px;
    }
}

@media (max-width: 480px) {
    .quadrant-meta-top,
    .quadrant-meta-bottom {
        flex-wrap: wrap;
        gap: 8px;
    }

    .quadrant-tag--side {
        display: none;
    }
}
