/* Root Theme Tokens */
:root {
    --bg-dark: #090d16;
    --bg-card: rgba(18, 24, 38, 0.75);
    --bg-card-hover: rgba(26, 35, 56, 0.85);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(99, 102, 241, 0.4);
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #6b7280;

    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-code: 'Fira Code', monospace;

    --glass-blur: blur(16px);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Background Glows */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.35;
}

.bg-glow-1 {
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
}

.bg-glow-2 {
    top: 40%;
    right: -10%;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, #ec4899 0%, transparent 70%);
}

.bg-glow-3 {
    bottom: -10%;
    left: 20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
}

/* Typography Utilities */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(9, 13, 22, 0.8);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.15);
    padding: 6px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.brand-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

.brand-tag {
    color: var(--primary);
    margin-left: 2px;
}

.domain-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    font-family: var(--font-code);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-main);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

.btn-xs {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Glass Panels */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: var(--transition);
}

.glass-panel:hover {
    border-color: var(--border-glow);
}

/* Hero Section */
.hero-section {
    padding: 5rem 0 3rem 0;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    font-size: 0.85rem;
    font-weight: 500;
    color: #a5b4fc;
    margin-bottom: 1.5rem;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
}

.badge-dot.blink {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

.hero-title {
    font-size: 3.25rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 1.25rem;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 720px;
    margin: 0 auto 2.5rem auto;
}

/* Prompt Box */
.prompt-box-wrapper {
    max-width: 800px;
    margin: 0 auto 2.5rem auto;
}

.prompt-box {
    background: rgba(18, 24, 38, 0.9);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.2);
}

.prompt-input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(9, 13, 22, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem 0.5rem 1rem;
    margin-bottom: 0.75rem;
}

.prompt-input-row input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
}

.preset-prompts {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.preset-label {
    color: var(--text-dark);
}

.preset-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.25rem 0.75rem;
    border-radius: 14px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.preset-chip:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
    border-color: rgba(99, 102, 241, 0.4);
}

/* Execution Visualizer Console */
.execution-visualizer {
    max-width: 800px;
    margin: 0 auto;
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-align: left;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.viz-header {
    background: #161b22;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.viz-dots {
    display: flex;
    gap: 6px;
}

.viz-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.viz-dots .dot.red { background: #ff5f56; }
.viz-dots .dot.yellow { background: #ffbd2e; }
.viz-dots .dot.green { background: #27c93f; }

.viz-title {
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.viz-model {
    font-size: 0.75rem;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
}

.viz-body {
    padding: 1rem;
    font-family: var(--font-code);
    font-size: 0.85rem;
    min-height: 140px;
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.console-line.info { color: #8b949e; }
.console-line.ready { color: #58a6ff; }
.console-line.exec { color: #d2a8ff; }
.console-line.success { color: #7ee787; }
.console-line.warn { color: #ffa657; }

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* Studio Section */
.studio-section {
    padding: 4rem 0;
}

.studio-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
}

.panel-subtitle {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agent-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.agent-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.agent-item:hover, .agent-item.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
}

.agent-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.agent-avatar.purple { background: rgba(139, 92, 246, 0.2); }
.agent-avatar.red { background: rgba(239, 68, 68, 0.2); }
.agent-avatar.blue { background: rgba(59, 130, 246, 0.2); }
.agent-avatar.green { background: rgba(16, 185, 129, 0.2); }

.agent-name {
    font-weight: 600;
    font-size: 0.9rem;
}
.agent-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.subagent-status {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.subagent-header {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #ec4899);
}

.stat-detail {
    font-size: 0.75rem;
    color: var(--text-dark);
}

/* Workbench Card */
.workbench-card {
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

.workbench-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.tab-btn:hover, .tab-btn.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
}

.tab-content.active {
    display: flex;
}

.chat-stream {
    flex: 1;
    background: rgba(9, 13, 22, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    overflow-y: auto;
    max-height: 320px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.message {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.msg-author {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.msg-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}

.message.user-msg .msg-bubble {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    align-self: flex-end;
}

.workbench-input-area {
    display: flex;
    gap: 0.75rem;
}

.workbench-input-area textarea {
    flex: 1;
    background: rgba(9, 13, 22, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    resize: none;
}

.workbench-input-area textarea:focus {
    border-color: var(--primary);
}

/* Artifact & Diff Viewers */
.artifact-viewer, .diff-viewer {
    background: #0d1117;
    border-radius: var(--radius-sm);
    padding: 1rem;
    flex: 1;
}

.artifact-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.artifact-filename {
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: var(--primary);
}

.code-block, .diff-code {
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: #e6edf3;
    white-space: pre-wrap;
}

.diff-head { color: #8b949e; }
.diff-add { color: #7ee787; background: rgba(46, 160, 67, 0.15); display: block; }
.diff-del { color: #ffa657; background: rgba(218, 54, 51, 0.15); display: block; }

/* Features Grid */
.features-section {
    padding: 4rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    text-align: left;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Metrics Section */
.metrics-section {
    padding: 4rem 0;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    text-align: center;
}

.metric-value {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}
.green-text { color: #34d399; }
.blue-text { color: #60a5fa; }
.purple-text { color: #c084fc; }
.pink-text { color: #f472b6; }

.metric-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.graph-card {
    padding: 1.5rem;
}

.graph-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin-bottom: 1rem;
}

.live-tag {
    font-size: 0.75rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 4px;
}

.canvas-container {
    width: 100%;
}

/* API Section */
.api-section {
    padding: 4rem 0 6rem 0;
}

.api-card {
    max-width: 800px;
    margin: 0 auto;
}

.api-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.api-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.4rem 1rem;
    font-family: var(--font-code);
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.api-tab.active {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
}

.api-code-wrapper {
    position: relative;
    background: #0d1117;
    border-radius: var(--radius-sm);
    padding: 1.25rem;
}

.api-code {
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: #e6edf3;
    overflow-x: auto;
}

.btn-copy {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

/* Footer */
.footer {
    background: #060911;
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1.5rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-brand p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--text-main);
}

.footer-bottom {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-dark);
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.toast {
    background: rgba(18, 24, 38, 0.95);
    border: 1px solid var(--primary);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    font-size: 0.9rem;
    animation: fadeInRight 0.3s ease-out;
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    .hero-title { font-size: 2.25rem; }
    .studio-grid { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .mobile-menu-toggle { display: flex; }
    .footer-content { flex-direction: column; gap: 1.5rem; text-align: center; }
}
