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

:root {
    --bg: #0c1222;
    --bg-secondary: rgba(15, 23, 42, 0.6);
    --bg-tertiary: rgba(30, 41, 59, 0.7);
    --fg: #e2e8f0;
    --fg-muted: #94a3b8;
    --accent: #60a5fa;
    --accent-glow: rgba(96, 165, 250, 0.15);
    --accent-bright: #93c5fd;
    --accent2: #a78bfa;
    --accent3: #34d399;
    --green: #4ade80;
    --red: #f87171;
    --yellow: #fbbf24;
    --orange: #fb923c;
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    --radius: 12px;
    --shell-bg: #0d1117;
    --shell-header: #161b22;
    --shell-border: #21262d;
    --shell-focus-border: #60a5fa;
    --glow-blue: 0 0 20px rgba(96, 165, 250, 0.2), 0 0 60px rgba(96, 165, 250, 0.08);
    --glow-green: 0 0 12px rgba(74, 222, 128, 0.4);
    --shadow-float: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-elevated: 0 16px 64px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3);
    --glass-bg: rgba(15, 23, 42, 0.5);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(20px) saturate(1.3);
}

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

code {
    font-family: 'Fira Code', 'JetBrains Mono', 'Cascadia Code', Menlo, monospace;
    background: rgba(22, 27, 34, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.accent { color: var(--accent); }

/* =========================================
   Aurora Background (Landing + Terminal)
   ========================================= */

.bg-aurora {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.aurora-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    will-change: transform;
}

.aurora-orb-1 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.6) 0%, rgba(59, 130, 246, 0.3) 35%, rgba(37, 99, 235, 0.1) 60%, transparent 75%);
    top: -20%;
    left: -10%;
    animation: aurora-drift-1 16s ease-in-out infinite;
}

.aurora-orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.55) 0%, rgba(139, 92, 246, 0.25) 35%, rgba(109, 40, 217, 0.08) 60%, transparent 75%);
    top: 15%;
    right: -12%;
    animation: aurora-drift-2 20s ease-in-out infinite;
}

.aurora-orb-3 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.45) 0%, rgba(16, 185, 129, 0.2) 35%, rgba(5, 150, 105, 0.06) 60%, transparent 75%);
    bottom: -15%;
    left: 25%;
    animation: aurora-drift-3 18s ease-in-out infinite;
}

@keyframes aurora-drift-1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.9; }
    25% { transform: translate(100px, 50px) scale(1.15); opacity: 1; }
    50% { transform: translate(40px, 80px) scale(1.05); opacity: 0.85; }
    75% { transform: translate(-60px, 30px) scale(0.95); opacity: 0.95; }
}

@keyframes aurora-drift-2 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.85; }
    25% { transform: translate(-80px, 60px) scale(1.1); opacity: 0.95; }
    50% { transform: translate(-30px, -40px) scale(0.9); opacity: 1; }
    75% { transform: translate(50px, 20px) scale(1.05); opacity: 0.8; }
}

@keyframes aurora-drift-3 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.8; }
    25% { transform: translate(60px, -50px) scale(1.08); opacity: 0.9; }
    50% { transform: translate(-40px, -20px) scale(1.12); opacity: 1; }
    75% { transform: translate(-80px, 40px) scale(0.95); opacity: 0.85; }
}

/* Animated Grid Overlay (Landing) */
.bg-grid-landing {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(96, 165, 250, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(96, 165, 250, 0.06) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at 50% 40%, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, black 30%, transparent 75%);
    animation: grid-pulse 8s ease-in-out infinite;
}

@keyframes grid-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Mouse-follow glow (injected by JS) */
.mouse-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.12) 0%, rgba(139, 92, 246, 0.06) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: left 0.3s ease, top 0.3s ease;
}

/* Floating particles (injected by JS) */
.particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: float-up linear forwards;
}

@keyframes float-up {
    0% { transform: translateY(0) scale(1); opacity: 0.8; }
    100% { transform: translateY(-100vh) scale(0.3); opacity: 0; }
}

/* =========================================
   Glassmorphism Utilities
   ========================================= */

.glass-card {
    background: var(--glass-bg) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border) !important;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.glass-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(96, 165, 250, 0.08) 0%, transparent 50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.glass-card:hover::after { opacity: 1; }

.glass-card:hover {
    background: rgba(15, 23, 42, 0.6) !important;
    border-color: rgba(96, 165, 250, 0.2) !important;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25), 0 0 30px rgba(96, 165, 250, 0.08);
    transform: translateY(-3px);
}

.glow-border {
    position: relative;
    border: 1px solid rgba(96, 165, 250, 0.2) !important;
    box-shadow: 0 0 40px rgba(96, 165, 250, 0.08), inset 0 0 30px rgba(96, 165, 250, 0.03);
}

.glow-border::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), transparent 40%, transparent 60%, rgba(167, 139, 250, 0.15));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.glow-border:hover::before { opacity: 1; }
.glow-border:hover {
    box-shadow: 0 0 50px rgba(96, 165, 250, 0.12), inset 0 0 30px rgba(96, 165, 250, 0.04);
}

/* =========================================
   Landing Page
   ========================================= */

.landing {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px 60px;
    z-index: 1;
}

/* Navigation Bar */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 20px;
}

.nav-logo {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--fg);
    text-decoration: none;
}

.nav-logo:hover { text-decoration: none; }

.nav-links { display: flex; gap: 24px; align-items: center; }

.nav-link {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--fg-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover { color: var(--fg); text-decoration: none; }

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 0 40px;
    margin-bottom: 40px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(88, 166, 255, 0.08);
    border: 1px solid rgba(88, 166, 255, 0.15);
    border-radius: 100px;
    padding: 6px 18px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 28px;
    backdrop-filter: blur(10px);
}

.hero-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px rgba(63, 185, 80, 0.6);
    animation: pulse-dot 2s ease-in-out infinite;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 16px;
    line-height: 1.1;
}

.gradient-text {
    background: linear-gradient(135deg, #58a6ff 0%, #a78bfa 50%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1.4rem;
    color: var(--fg);
    margin-bottom: 8px;
    font-weight: 500;
}

.subtitle {
    font-size: 1rem;
    color: var(--fg-muted);
    margin-bottom: 0;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 32px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4);
}

.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--fg);
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    text-decoration: none;
    transform: translateY(-1px);
}

/* Install Section */
.install-section { margin-bottom: 48px; }
.install-section h2 { font-size: 1.5rem; margin-bottom: 16px; }

.code-block {
    background: rgba(13, 17, 23, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(22, 27, 34, 0.6);
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--fg-muted);
}

.code-header-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ch-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.ch-red { background: #ff5f57; }
.ch-yellow { background: #febc2e; }
.ch-green { background: #28c840; }

.copy-btn {
    background: rgba(22, 27, 34, 0.8);
    border: 1px solid var(--border);
    color: var(--fg-muted);
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.copy-btn:hover { color: var(--fg); border-color: rgba(255, 255, 255, 0.15); }

.code-block pre { padding: 16px; overflow-x: auto; line-height: 1.6; }
.code-block code { background: none; padding: 0; font-size: 0.9rem; color: var(--fg); }

.alt-install { margin-top: 16px; }
.alt-install p { font-size: 0.9rem; color: var(--fg-muted); margin-bottom: 10px; }

.download-links { display: flex; gap: 10px; flex-wrap: wrap; }

.dl-btn {
    display: inline-block;
    background: rgba(13, 17, 23, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    transition: all 0.25s;
    text-decoration: none;
}

.dl-btn:hover {
    border-color: rgba(88, 166, 255, 0.3);
    color: var(--accent);
    text-decoration: none;
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.08);
}

.demo-section { margin-bottom: 48px; }
.prompt { color: var(--green); }
.c-accent { color: var(--accent); font-weight: bold; }
.c-bold { font-weight: bold; color: var(--fg); }
.c-link { color: var(--accent); text-decoration: underline; }
.c-dim { color: var(--fg-muted); }

/* Features Grid */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 60px;
}

.feature {
    border-radius: 16px;
    padding: 28px;
}

.feature-icon-wrap {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.15);
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.glass-card:hover .feature-icon-wrap {
    background: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.15);
}

.feature-icon { font-size: 1.4rem; line-height: 1; }
.feature h3 { font-size: 1.05rem; margin-bottom: 8px; font-weight: 600; }
.feature p { color: var(--fg-muted); font-size: 0.88rem; line-height: 1.6; }

/* How it Works */
.how-it-works { margin-bottom: 60px; }
.how-it-works h2 {
    font-size: 1.8rem;
    margin-bottom: 32px;
    text-align: center;
    font-weight: 700;
}
.steps { display: flex; gap: 20px; justify-content: center; }

.step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border-radius: 16px;
    padding: 24px;
    flex: 1;
}

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.step strong { display: block; margin-bottom: 4px; font-size: 0.95rem; }
.step-detail { font-size: 0.85rem; color: var(--fg-muted); line-height: 1.5; }

/* Tech Section */
.tech-section { margin-bottom: 60px; }
.tech-section h2 {
    font-size: 1.8rem;
    margin-bottom: 32px;
    text-align: center;
    font-weight: 700;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.tech-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: var(--radius);
    padding: 18px;
}

.tech-label {
    font-size: 0.72rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.tech-item span:last-child { font-size: 0.9rem; color: var(--fg); }

footer {
    text-align: center;
    color: var(--fg-muted);
    font-size: 0.85rem;
    padding: 40px 0 20px;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

/* =========================================
   Terminal Page — Infinite Canvas
   ========================================= */

.terminal-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #0a1025;
}

/* Terminal Page Aurora Background */
.terminal-page .bg-aurora { z-index: 0; }

.terminal-page .aurora-orb-1 {
    width: 600px;
    height: 600px;
    top: -25%;
    left: -15%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.35) 0%, rgba(59, 130, 246, 0.15) 40%, transparent 70%);
}

.terminal-page .aurora-orb-2 {
    width: 500px;
    height: 500px;
    top: 30%;
    right: -18%;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.3) 0%, rgba(139, 92, 246, 0.12) 40%, transparent 70%);
}

.terminal-page .aurora-orb-3 {
    width: 450px;
    height: 450px;
    bottom: -20%;
    left: 35%;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.25) 0%, rgba(16, 185, 129, 0.1) 40%, transparent 70%);
}

/* Floating Toolbar — glassmorphism */
#toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 46px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    background: rgba(10, 16, 37, 0.65);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 100;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-center { gap: 6px; }

.logo {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.session-badge {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--fg-muted);
    background: rgba(33, 38, 45, 0.6);
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    letter-spacing: 0.02em;
}

.status {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 12px;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status.connecting { color: var(--yellow); background: rgba(210, 153, 34, 0.1); }
.status.connecting::before { background: var(--yellow); animation: pulse-dot 1.5s ease-in-out infinite; }
.status.connected { color: var(--green); background: rgba(63, 185, 80, 0.1); }
.status.connected::before { background: var(--green); box-shadow: var(--glow-green); }
.status.disconnected { color: var(--red); background: rgba(248, 81, 73, 0.1); }
.status.disconnected::before { background: var(--red); }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(22, 27, 34, 0.7);
    border: 1px solid var(--border);
    color: var(--fg-muted);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.76rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-weight: 500;
}

.tool-btn:hover {
    color: var(--accent);
    border-color: rgba(88, 166, 255, 0.4);
    background: rgba(88, 166, 255, 0.08);
    box-shadow: 0 0 12px rgba(88, 166, 255, 0.08);
}

.tool-btn:active {
    transform: scale(0.97);
}

.tool-btn svg { flex-shrink: 0; }

.zoom-badge {
    font-family: 'Fira Code', monospace;
    font-size: 0.68rem;
    color: var(--fg-muted);
    min-width: 36px;
    text-align: center;
    opacity: 0.7;
}

.user-avatars {
    display: flex;
    gap: -4px;
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #0d1117;
    margin-left: -4px;
    border: 2px solid var(--bg-secondary);
    cursor: default;
    transition: transform 0.15s;
}

.user-avatar:first-child { margin-left: 0; }
.user-avatar:hover { transform: scale(1.15); z-index: 2; }

.viewers-count {
    font-size: 0.72rem;
    color: var(--fg-muted);
    opacity: 0.8;
}

/* Viewport (full screen canvas area) */
#viewport {
    position: fixed;
    top: 46px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    cursor: grab;
}

#viewport.panning { cursor: grabbing; }

/* Dotted Grid Background */
#grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(96, 165, 250, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* Canvas (transformed container) */
#canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform-origin: 0 0;
    z-index: 1;
}

/* Cursor Layer */
#cursor-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 999;
}

/* =========================================
   Shell (Floating Terminal Window)
   ========================================= */

.shell {
    position: absolute;
    display: flex;
    flex-direction: column;
    background: var(--shell-bg);
    border: 1px solid var(--shell-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-float);
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    cursor: default;
}

.shell.focused {
    border-color: rgba(88, 166, 255, 0.5);
    box-shadow: var(--shadow-elevated), 0 0 0 1px rgba(88, 166, 255, 0.2), var(--glow-blue);
}

.shell.dragging {
    opacity: 0.88;
    cursor: grabbing;
    box-shadow: var(--shadow-elevated), 0 0 40px rgba(0, 0, 0, 0.4);
}

.shell.resizing {
    opacity: 0.95;
}

/* Closing Animation */
.shell.closing {
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Minimized State */
.shell.minimized .shell-body,
.shell.minimized .shell-resize {
    display: none;
}

.shell.minimized {
    height: auto !important;
    min-height: 0;
    border-radius: 10px;
}

/* Maximized State */
.shell.maximized {
    border-radius: 8px;
    border-color: rgba(88, 166, 255, 0.4);
    box-shadow: var(--shadow-elevated), var(--glow-blue);
}

/* =========================================
   Shell Header — macOS Traffic Lights
   ========================================= */

.shell-header {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 12px;
    background: var(--shell-header);
    border-bottom: 1px solid var(--shell-border);
    cursor: grab;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
    height: 38px;
}

.shell-header:active { cursor: grabbing; }

/* Traffic Lights (macOS-style close/minimize/maximize) */
.traffic-lights {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 4px 0 0;
    margin-right: 8px;
    flex-shrink: 0;
}

.tl-btn {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s ease;
    position: relative;
}

.tl-btn svg {
    opacity: 0;
    transition: opacity 0.1s;
    pointer-events: none;
}

.tl-btn:active {
    transform: scale(0.85);
}

/* Colors: idle state (muted dots) */
.tl-close {
    background: #4a4a4a;
}

.tl-minimize {
    background: #4a4a4a;
}

.tl-maximize {
    background: #4a4a4a;
}

/* Colors: hover on header reveals colored dots */
.shell-header:hover .tl-close,
.shell.focused .tl-close {
    background: #ff5f57;
}

.shell-header:hover .tl-minimize,
.shell.focused .tl-minimize {
    background: #febc2e;
}

.shell-header:hover .tl-maximize,
.shell.focused .tl-maximize {
    background: #28c840;
}

/* Show SVG icons on button hover */
.tl-btn:hover svg {
    opacity: 1;
}

.tl-close svg { color: #4a0000; }
.tl-minimize svg { color: #5a3d00; }
.tl-maximize svg { color: #003d0a; }

/* Hover glow on individual buttons */
.tl-close:hover { box-shadow: 0 0 8px rgba(255, 95, 87, 0.5); }
.tl-minimize:hover { box-shadow: 0 0 8px rgba(254, 188, 46, 0.5); }
.tl-maximize:hover { box-shadow: 0 0 8px rgba(40, 200, 64, 0.5); }

/* Shell Title Area */
.shell-title-area {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.shell-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--fg-muted);
    opacity: 0.25;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.shell-dot.on {
    background: var(--green);
    opacity: 1;
    box-shadow: var(--glow-green);
}

.shell-title {
    flex: 1;
    font-size: 0.78rem;
    color: var(--fg-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.shell.focused .shell-title { color: var(--fg); }

/* Shell Header Right */
.shell-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 8px;
}

.shell-tid {
    font-family: 'Fira Code', monospace;
    font-size: 0.62rem;
    color: var(--fg-muted);
    opacity: 0.5;
    background: rgba(33, 38, 45, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

/* Shell Body (xterm container) */
.shell-body {
    flex: 1;
    overflow: hidden;
    padding: 4px;
}

.shell-body .xterm { height: 100%; }
.shell-body .xterm-viewport { overflow-y: auto !important; }

/* Shell Resize Handle */
.shell-resize {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
    z-index: 5;
}

.shell-resize::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--fg-muted);
    border-bottom: 2px solid var(--fg-muted);
    opacity: 0;
    transition: opacity 0.15s;
}

.shell:hover .shell-resize::after { opacity: 0.3; }
.shell-resize:hover::after { opacity: 0.7 !important; }

/* =========================================
   Remote Cursors
   ========================================= */

.remote-cursor {
    position: absolute;
    pointer-events: none;
    z-index: 500;
    transition: transform 0.08s linear;
}

.remote-cursor svg {
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.6));
}

.cursor-name {
    position: absolute;
    top: 18px;
    left: 12px;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.62rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    pointer-events: none;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* =========================================
   Name Modal
   ========================================= */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 11, 16, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(8px);
}

.modal-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 36px;
    width: 380px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(88, 166, 255, 0.05);
}

.modal-box h2 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.modal-box p { color: var(--fg-muted); font-size: 0.9rem; margin-bottom: 24px; line-height: 1.5; }

.modal-box input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--fg);
    font-size: 1rem;
    outline: none;
    margin-bottom: 16px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-box input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.12);
}

.modal-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #58a6ff, #3b82f6);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}

.modal-btn:hover {
    opacity: 0.92;
    box-shadow: 0 4px 16px rgba(88, 166, 255, 0.3);
}

.modal-btn:active {
    transform: scale(0.98);
}

/* =========================================
   Overlay
   ========================================= */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 11, 16, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.overlay-content { text-align: center; }

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }
.overlay-content p { color: var(--fg-muted); font-size: 1rem; }

/* =========================================
   Responsive — Landing Page
   ========================================= */

@media (max-width: 768px) {
    .hero h1 { font-size: 2.8rem; }
    .hero { padding: 40px 0 30px; }
    .features { grid-template-columns: 1fr; }
    .tech-grid { grid-template-columns: 1fr 1fr; }
    .steps { flex-direction: column; }
    .landing { padding: 0 16px 40px; }
    .download-links { flex-direction: column; }
    .dl-btn { text-align: center; }
    .aurora-orb-1 { width: 350px; height: 350px; }
    .aurora-orb-2 { width: 300px; height: 300px; }
    .aurora-orb-3 { width: 250px; height: 250px; }
    .hero-actions { flex-direction: column; align-items: center; }
    .btn-primary, .btn-ghost { width: 100%; justify-content: center; max-width: 280px; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 2.2rem; }
    .tech-grid { grid-template-columns: 1fr; }
    .nav-links { gap: 16px; }
}

/* =========================================
   Responsive — Terminal Page
   ========================================= */

@media (max-width: 640px) {
    .tool-btn span { display: none; }
    .toolbar-center { gap: 4px; }
    .zoom-badge { display: none; }
    .session-badge { display: none; }

    .shell-header { height: 34px; padding: 0 8px; }
    .traffic-lights { gap: 5px; }
    .tl-btn { width: 11px; height: 11px; }
    .shell-tid { display: none; }
}
