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

:root {
    --bg: hsl(220 20% 7%);
    --primary: hsl(197 100% 50%);
    --primary-dim: hsl(197 100% 30%);
    --text: hsl(220 10% 90%);
    --muted: hsl(220 10% 62%);
    --terminal-bg: hsl(220 20% 10%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow: hidden;
}

#synapses {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
}

.logo {
    color: var(--primary);
    margin-bottom: 2rem;
    animation: pulse 1.4s ease-in-out infinite;
    filter: drop-shadow(0 0 6px var(--primary));
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 6px var(--primary)); }
    50% { opacity: 0.4; transform: scale(1.2); filter: drop-shadow(0 0 18px var(--primary)); }
}

h1 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 2.5rem;
    color: var(--text);
}

.terminal {
    position: relative;
    isolation: isolate;
    background: linear-gradient(135deg, hsl(220 20% 14% / 0.32), hsl(220 20% 9% / 0.22));
    backdrop-filter: url(#liquid-glass) blur(10px) saturate(1.5);
    -webkit-backdrop-filter: blur(10px) saturate(1.5);
    border: 1px solid hsl(220 20% 55% / 0.18);
    border-radius: 16px;
    padding: 13px 2rem;
    width: 100%;
    max-width: 400px;
    margin-bottom: 2rem;
    box-shadow:
        0 10px 40px hsl(220 40% 4% / 0.55),
        0 2px 8px hsl(220 40% 4% / 0.3),
        inset 0 1px 0 hsl(220 20% 95% / 0.22),
        inset 0 -1px 0 hsl(220 40% 0% / 0.3),
        inset 1px 0 0 hsl(220 20% 95% / 0.08),
        inset -1px 0 0 hsl(220 40% 0% / 0.18);
}

/* Specular sheen — top-edge highlight fading down */
.terminal::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        180deg,
        hsl(220 20% 100% / 0.14) 0%,
        hsl(220 20% 100% / 0.04) 28%,
        transparent 55%,
        hsl(220 40% 0% / 0.1) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* Refractive rim — diagonal gradient border light */
.terminal::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        135deg,
        hsl(220 20% 100% / 0.3),
        hsl(197 100% 70% / 0.08) 35%,
        transparent 55%,
        hsl(220 20% 100% / 0.15) 100%
    );
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}

.terminal > * {
    position: relative;
    z-index: 3;
}

.terminal-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s, transform 0.5s;
}

.terminal-line.visible {
    opacity: 1;
    transform: translateY(0);
}

.terminal-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.85rem;
    color: var(--muted);
}

.terminal-line.visible .terminal-text {
    color: var(--text);
}

.terminal-status {
    font-size: 0.875rem;
    min-width: 1.5rem;
    text-align: right;
}

.terminal-status.done {
    color: hsl(142 76% 50%);
}

.terminal-status.spinner {
    color: transparent;
    display: block;
    width: 14px;
    height: 14px;
    min-width: 14px;
    font-size: 0;
    line-height: 0;
    border: 2px solid hsl(197 100% 50% / 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.terminal-footer {
    font-size: 0.75rem;
    color: var(--muted);
    opacity: 0.6;
    margin-top: 13px;
    padding-top: 13px;
    border-top: 1px solid hsl(220 20% 40% / 0.15);
    line-height: 1.8;
}

/* Error states */
body.status-error .logo {
    color: hsl(0 70% 50%);
    animation: none;
}

body.status-error h1 {
    color: hsl(0 70% 70%);
}

/* Mobile */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .terminal {
        padding: 1rem 1.25rem;
    }
    
    .terminal-text {
        font-size: 0.75rem;
    }
}
