/* bada.systems - Isometric Marine Engineering */

:root {
    --abyss: #0B1628;
    --trench: #122240;
    --shelf: #1A2C4A;
    --teal: #3DE8D4;
    --steel: #6B8FA8;
    --foam: #C8E6F0;
    --drift: #8AA4B8;
    --vent: #E85D3D;
    --meso: #1E3A5C;
    --euphotic: #2A5278;
    --benthic: #060D18;
    --depth: 0;
}

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

html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--abyss);
    color: var(--drift);
    overflow-x: hidden;
    line-height: 1.7;
}

/* Status Bar */
.status-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--teal);
    z-index: 1000;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(61, 232, 212, 0.4);
}

/* Isometric Grid Background */
.iso-grid-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.15;
    background-image:
        linear-gradient(30deg, var(--shelf) 1px, transparent 1px),
        linear-gradient(150deg, var(--shelf) 1px, transparent 1px),
        linear-gradient(90deg, var(--shelf) 1px, transparent 1px);
    background-size: 60px 104px, 60px 104px, 60px 104px;
}

/* Console Header */
.console-header {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--abyss);
    overflow: hidden;
}

.console-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.nameplate {
    display: inline-block;
    transform: perspective(600px) rotateX(10deg) rotateY(-5deg);
    padding: 30px 60px;
    border: 1px solid var(--shelf);
    background: var(--trench);
    box-shadow: 4px 8px 30px rgba(11, 22, 40, 0.8), 0 0 40px rgba(61, 232, 212, 0.05);
}

.nameplate-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--foam);
}

.status-readout {
    margin-top: 30px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.04em;
    color: var(--teal);
    text-shadow: 0 0 8px rgba(61, 232, 212, 0.3);
}

.readout-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--teal);
    animation: typewriter 2.5s steps(38) 0.5s forwards, blinkCursor 0.8s step-end infinite;
    width: 0;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 38ch; }
}

@keyframes blinkCursor {
    50% { border-color: transparent; }
}

/* Topology Map */
.topology-map {
    position: relative;
    min-height: 300vh;
    padding: 10vh 5vw;
    background: var(--abyss);
}

.connections-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.connection-path {
    fill: none;
    stroke: var(--teal);
    stroke-width: 2;
    opacity: 0.4;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    will-change: stroke-dashoffset;
}

.connection-path.animated {
    animation: flowData 3s ease-in-out infinite;
}

@keyframes flowData {
    0% { stroke-dashoffset: 500; opacity: 0.3; }
    50% { stroke-dashoffset: 0; opacity: 0.6; }
    100% { stroke-dashoffset: -500; opacity: 0.3; }
}

.node-pulse {
    fill: var(--teal);
    opacity: 0.6;
    animation: nodePulse 3s ease-in-out infinite;
}

@keyframes nodePulse {
    0%, 100% { r: 6; opacity: 0.4; }
    50% { r: 8; opacity: 0.8; }
}

/* Module Cards */
.module-card {
    position: absolute;
    width: 280px;
    z-index: 10;
    transform: skewY(-8deg);
    cursor: default;
}

.card-inner {
    transform: skewY(8deg);
    background: var(--trench);
    border: 1px solid var(--shelf);
    padding: 24px;
    position: relative;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.module-card:hover .card-inner {
    border-color: var(--teal);
    box-shadow: 0 4px 20px rgba(11, 22, 40, 0.6), 0 0 12px rgba(61, 232, 212, 0.15);
}

.card-status {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
}

.card-status.active {
    background: var(--teal);
    box-shadow: 0 0 6px rgba(61, 232, 212, 0.5);
}

.card-status.idle {
    background: var(--steel);
}

.card-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 12px;
}

.card-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--foam);
    margin-bottom: 10px;
}

.card-desc {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.7;
    color: var(--drift);
    margin-bottom: 12px;
}

.card-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--teal);
    text-shadow: 0 0 8px rgba(61, 232, 212, 0.3);
    opacity: 0.7;
}

/* Cross Section */
.cross-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.stratum {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 40px 8vw;
    position: relative;
}

.stratum-surface {
    background: var(--euphotic);
}

.stratum-thermo {
    background: var(--meso);
}

.stratum-bathyal {
    background: var(--shelf);
}

.stratum-abyssal {
    background: var(--abyss);
}

.stratum-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.04em;
    color: var(--teal);
    text-shadow: 0 0 8px rgba(61, 232, 212, 0.3);
    position: relative;
    z-index: 10;
}

.contour-lines {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    pointer-events: none;
}

.contour-lines svg {
    width: 100%;
    height: 100%;
}

/* Signal Floor */
.signal-floor {
    position: relative;
    min-height: 100vh;
    background: var(--benthic);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bioluminescent-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.bio-particle {
    position: absolute;
    border-radius: 50%;
    animation: bioFloat var(--float-dur, 10s) ease-in-out infinite;
    animation-delay: var(--float-delay, 0s);
}

@keyframes bioFloat {
    0%, 100% { opacity: 0.1; transform: translate(0, 0); }
    50% { opacity: 0.6; transform: translate(var(--drift-x, 8px), var(--drift-y, -12px)); }
}

.signal-center {
    position: relative;
    z-index: 10;
    margin-bottom: 60px;
}

.signal-dot {
    width: 8px;
    height: 8px;
    background: var(--teal);
    border-radius: 50%;
    animation: signalPulse 3s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(61, 232, 212, 0.4), 0 0 60px rgba(61, 232, 212, 0.15);
}

/* Vent orange appearance */
.signal-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--vent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ventPulse 5s ease-in-out infinite 2s;
    opacity: 0;
}

@keyframes ventPulse {
    0%, 80%, 100% { opacity: 0; }
    90% { opacity: 1; }
}

@keyframes signalPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(61, 232, 212, 0.4); }
    50% { transform: scale(1.4); box-shadow: 0 0 40px rgba(61, 232, 212, 0.6), 0 0 80px rgba(61, 232, 212, 0.2); }
}

.signal-log {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 600px;
}

.log-entry {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--teal);
    text-shadow: 0 0 8px rgba(61, 232, 212, 0.3);
    opacity: 0.7;
}

.log-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    border-right: 1px solid var(--teal);
}

.log-text.typing {
    animation: typewriterLog 4s steps(75) forwards, blinkCursor 0.8s step-end infinite;
}

@keyframes typewriterLog {
    from { width: 0; }
    to { width: 75ch; }
}

/* System Footer */
.system-footer {
    padding: 30px 8vw;
    background: var(--benthic);
    text-align: center;
}

.footer-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--steel);
    opacity: 0.4;
}

/* Connected cards glow */
.module-card.neighbor-glow .card-inner {
    box-shadow: 0 0 12px rgba(61, 232, 212, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .module-card {
        position: relative;
        top: auto !important;
        left: auto !important;
        width: 90vw;
        margin: 20px auto;
        transform: skewY(-4deg);
    }

    .card-inner {
        transform: skewY(4deg);
    }

    .connections-svg {
        display: none;
    }

    .topology-map {
        min-height: auto;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .cross-section {
        min-height: auto;
    }

    .stratum {
        padding: 30px 5vw;
    }
}
