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

:root {
    --terminal-black: #0b0e14;
    --phosphor-teal: #39ffc2;
    --amber-warning: #ffb347;
    --magenta-error: #ff3b7a;
    --dim-comment: #4a5568;
    --panel-surface: #141821;
    --status-blue: #5b9cf5;
    --bright-white: #e8ecf1;
    --border-color: #1e2433;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--terminal-black);
    color: var(--bright-white);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scan-line overlay */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.015) 0px,
        rgba(255, 255, 255, 0.015) 1px,
        transparent 1px,
        transparent 3px
    );
}

/* Floating elements */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.float-symbol {
    position: absolute;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: var(--dim-comment);
    animation: float 12s ease-in-out infinite alternate;
    opacity: 0.6;
}

.float-icon {
    position: absolute;
    animation: float 14s ease-in-out infinite alternate;
}

@keyframes float {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-8px); }
}

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

/* Command Palette Trigger */
.cmd-palette-trigger {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    background: var(--panel-surface);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s, transform 0.2s;
}

.cmd-palette-trigger:hover {
    border-color: var(--phosphor-teal);
    transform: scale(1.1);
}

/* Command Palette Overlay */
.cmd-palette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 14, 20, 0.85);
    z-index: 10000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20vh;
}

.cmd-palette-overlay.active {
    display: flex;
}

.cmd-palette {
    background: var(--panel-surface);
    border: 1px solid var(--status-blue);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    overflow: hidden;
}

.cmd-palette-input-wrap {
    display: flex;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
}

.cmd-palette-input-wrap .cmd-prompt {
    color: var(--phosphor-teal);
    font-family: 'Share Tech Mono', monospace;
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.cmd-palette-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--bright-white);
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    width: 100%;
}

.cmd-palette-results {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.cmd-palette-results li {
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--bright-white);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
}

.cmd-palette-results li:hover {
    background: rgba(57, 255, 194, 0.08);
    color: var(--phosphor-teal);
}

.cmd-palette-results li svg {
    flex-shrink: 0;
}

/* Scenes */
.scene {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    position: relative;
    z-index: 2;
}

.scene-boot {
    min-height: 100vh;
}

.scene-services {
    min-height: 100vh;
    gap: 0;
    flex-wrap: wrap;
}

.scene-process {
    min-height: 100vh;
}

.scene-security {
    min-height: 80vh;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.scene-connect {
    min-height: 60vh;
}

/* Terminal Windows */
.terminal-window {
    background: var(--panel-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.terminal-titlebar {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    background: rgba(20, 24, 33, 0.8);
    border-bottom: 1px solid var(--border-color);
    gap: 0.5rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red { background: var(--magenta-error); }
.dot-amber { background: var(--amber-warning); }
.dot-green { background: var(--phosphor-teal); }

.terminal-path {
    margin-left: 0.75rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--dim-comment);
}

.terminal-body {
    padding: 1.5rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    line-height: 1.8;
}

.terminal-line.command {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.terminal-line .prompt {
    color: var(--phosphor-teal);
    margin-right: 0.5rem;
}

.terminal-line .typed-text {
    color: var(--phosphor-teal);
    letter-spacing: 0.05em;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--phosphor-teal);
    margin-left: 2px;
    animation: blink 1s step-end infinite;
}

.terminal-output {
    opacity: 0;
    transition: opacity 0.3s;
}

.terminal-output.visible {
    opacity: 1;
}

.terminal-output .output-line {
    display: block;
    white-space: pre;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.75rem, 1.3vw, 0.95rem);
    line-height: 1.7;
}

/* Terminal layout variants */
.terminal-centered {
    width: 90%;
    max-width: 700px;
}

.terminal-left {
    width: 55%;
    max-width: 550px;
    position: absolute;
    left: 5%;
    top: 15%;
}

.terminal-right {
    width: 38%;
    max-width: 380px;
    position: absolute;
    right: 8%;
    bottom: 20%;
}

.terminal-wide {
    width: 90%;
    max-width: 800px;
}

.terminal-scatter-1 {
    width: 30%;
    max-width: 320px;
}

.terminal-scatter-2 {
    width: 30%;
    max-width: 320px;
}

.terminal-scatter-3 {
    width: 30%;
    max-width: 320px;
}

.terminal-minimal {
    max-width: 550px;
}

/* Scene 2 relative positioning */
.scene-services {
    position: relative;
}

/* Connect options */
.connect-options {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.connect-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--bright-white);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.connect-option:hover {
    border-color: var(--amber-warning);
    color: var(--amber-warning);
}

.connect-option:hover svg {
    stroke: var(--amber-warning);
}

/* Responsive */
@media (max-width: 768px) {
    .terminal-left,
    .terminal-right {
        position: relative;
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
        width: 95%;
        max-width: none;
        margin: 1rem auto;
    }

    .scene-services {
        flex-direction: column;
        align-items: center;
    }

    .terminal-scatter-1,
    .terminal-scatter-2,
    .terminal-scatter-3 {
        width: 90%;
        max-width: none;
    }
}
