@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Core Palette - Deep Space / Industrial Dark */
    --bg-main: #020617;
    /* Slate 950 */
    --bg-surface: #0f172a;
    /* Slate 900 */
    --bg-card: rgba(15, 23, 42, 0.8);
    --bg-glass: rgba(15, 23, 42, 0.6);

    /* Accents - Neon / Cyber */
    --accent-primary: #3b82f6;
    /* Blue 500 */
    --accent-glow: #60a5fa;
    /* Blue 400 */
    --accent-secondary: #8b5cf6;
    /* Violet 500 */
    --accent-cyan: #06b6d4;
    /* Cyan 500 */
    --accent-pink: #ec4899;
    /* Pink 500 */
    --accent-warning: #f59e0b;
    /* Amber 500 */
    --accent-success: #10b981;
    /* Emerald 500 */
    --accent-danger: #ef4444;
    /* Red 500 */

    /* Text */
    --text-primary: #f8fafc;
    /* Slate 50 */
    --text-secondary: #94a3b8;
    /* Slate 400 */
    --text-tertiary: #475569;
    /* Slate 600 */

    /* Typography */
    --font-sans: 'Outfit', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Effects */
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --blur-amt: 12px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    font-weight: 300;
    background: radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08), transparent 25%),
        #020617;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-sans);
    color: var(--text-primary);
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 3.5rem;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

a {
    color: var(--accent-glow);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-primary);
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

/* --- Utilities --- */
.text-gradient {
    background: linear-gradient(135deg, var(--accent-glow) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 35px rgba(59, 130, 246, 0.8);
    border-color: rgba(255, 255, 255, 0.4);
    color: white !important;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover::after {
    opacity: 1;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.05em;
    color: white;
}

.logo i {
    color: var(--accent-cyan);
    font-size: 1.5rem;
    filter: drop-shadow(0 0 5px rgba(6, 182, 212, 0.5));
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a:not(.btn) {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-links a:not(.btn):hover {
    color: var(--accent-cyan);
}

/* --- Hero Section - REVISED --- */
.hero {
    padding-top: 140px;
    /* Reduced top padding */
    padding-bottom: 6rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.12), transparent 70%);
    filter: blur(80px);
    z-index: 0;
    animation: pulse 8s infinite alternate;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    /* More space for visual */
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 10;
}

.hero-content {
    animation: fadeInUp 0.8s ease-out;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 8px #34d399;
    animation: pulse-fast 2s infinite;
}

@keyframes pulse-fast {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

.hero h1 {
    font-weight: 800;
    margin-bottom: 1.25rem;
    font-size: 4rem;
    line-height: 1.3;
    padding-bottom: 0.2rem;
    letter-spacing: -0.03em;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
    background: linear-gradient(to bottom right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 550px;
}

.hero-sub strong {
    color: var(--text-primary);
    font-weight: 500;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Mission Control UI (Visual) */
.hero-visual {
    perspective: 1500px;
    animation: fadeInRight 1s ease-out 0.2s backwards;
}

.mission-control-ui {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transform: rotateY(-10deg) rotateX(2deg);
    transition: transform 0.5s ease;
}

.mission-control-ui:hover {
    transform: rotateY(0deg) rotateX(0deg);
}

.mc-header {
    background: rgba(2, 6, 23, 0.8);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.mc-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-cyan);
    font-weight: 700;
}

.mc-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-indicator.online {
    background: var(--accent-success);
    box-shadow: 0 0 8px var(--accent-success);
}

.mc-body {
    display: grid;
    grid-template-columns: 180px 1fr;
    height: 320px;
}

.mc-sidebar {
    background: rgba(15, 23, 42, 0.5);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.5rem;
}

.mc-agent {
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
    cursor: default;
}

.mc-agent.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

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

.agent-name {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-primary);
    font-weight: bold;
}

.agent-state {
    font-size: 0.6rem;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 2px;
}

.agent-state.run {
    color: var(--accent-success);
    background: rgba(16, 185, 129, 0.1);
}

.agent-state.idle {
    color: var(--text-tertiary);
    background: rgba(255, 255, 255, 0.05);
}

.agent-meta {
    font-size: 0.65rem;
    color: var(--text-tertiary);
}

.mc-console {
    background: #0b1120;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.console-header {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-tertiary);
    display: flex;
    justify-content: space-between;
}

.console-tab {
    color: var(--accent-glow);
    position: relative;
}

.console-tab::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-glow);
}

.console-output {
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    overflow-y: hidden;
}

.log-line {
    margin-bottom: 0.4rem;
    display: flex;
    gap: 0.5rem;
}

.ts {
    color: var(--text-tertiary);
    opacity: 0.5;
}

.inf {
    color: var(--accent-glow);
}

.suc {
    color: var(--accent-success);
}

.cmd {
    color: var(--accent-pink);
}

.typing-indicator span {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-tertiary);
    margin-right: 2px;
    animation: blink 1s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Existing components maintained... */
.input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 1.25rem;
    border-radius: 8px;
    flex: 1;
    transition: all 0.3s;
}

.input-group:focus-within {
    border-color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

.input-group i {
    color: var(--text-secondary);
    margin-right: 0.75rem;
}

.input-group input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    height: 100%;
    padding: 0.875rem 0;
    font-family: var(--font-sans);
    outline: none;
    font-size: 1rem;
}

.input-group input::placeholder {
    color: var(--text-tertiary);
}

.cta-subtext {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Feature Sections specific visual overrides for final theme */
.marriage-step {
    background: var(--accent-gradient, linear-gradient(135deg, var(--accent-cyan), var(--accent-primary)));
    color: #fff;
    padding: 0.85rem 3rem;
    border-radius: 99px;
    font-family: var(--font-mono);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.5);
    z-index: 5;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-weight: 700;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.final-block {
    background: rgba(15, 23, 42, 0.95);
    color: var(--text-primary);
    padding: 1.75rem 3.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    border-radius: 8px;
    border: 1px solid var(--accent-success);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.2), inset 0 0 20px rgba(16, 185, 129, 0.05);
}

.notebook-ui {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 2.5rem;
    font-family: var(--font-mono);
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.notebook-ui::before {
    /* Binder aesthetic */
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.nb-entry {
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
}

.status.success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status.fail {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Feature sections */
section {
    padding: 8rem 0;
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
}

.feature-grid.reverse {
    direction: rtl;
}

.feature-grid.reverse>* {
    direction: ltr;
}

/* Keep chaos styles independent if needed, or assume they are in html style block */
/* For completeness of grid */
.feature-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
    background: rgba(6, 182, 212, 0.05);
    padding: 0.35rem 0.75rem;
    border-radius: 99px;
    margin-bottom: 1.5rem;
}

.feature-highlight {
    margin-top: 2rem;
    background: rgba(15, 23, 42, 0.6);
    border-left: 3px solid var(--accent-success);
    padding: 1.25rem;
    border-radius: 0 8px 8px 0;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.feature-highlight i {
    color: var(--accent-success);
    font-size: 1.5rem;
    margin-top: 0.2rem;
}

.assembly-line {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.lanes {
    display: flex;
    gap: 1rem;
    perspective: 600px;
}

.lane {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1.5rem 1rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    border-radius: 8px;
    min-width: 90px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    animation: float 6s ease-in-out infinite;
    backdrop-filter: blur(4px);
}

.lane:nth-child(2) {
    animation-delay: 1.5s;
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.dag-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.dag-node {
    border: 1px solid var(--text-tertiary);
    color: var(--text-tertiary);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-family: var(--font-mono);
    background: rgba(15, 23, 42, 0.5);
    transition: 0.3s;
}

.dag-node.process {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.1);
}

.dag-node.decision {
    width: 60px;
    height: 60px;
    transform: rotate(45deg);
    border-color: var(--accent-warning);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dag-node.decision span {
    transform: rotate(-45deg);
    color: var(--accent-warning);
    font-size: 0.7rem;
    font-weight: bold;
}

.terminal-window {
    background: #0d1117;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    font-family: 'JetBrains Mono', monospace;
    overflow: hidden;
}

.terminal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.term-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5f56;
    box-shadow: 16px 0 0 #ffbd2e, 32px 0 0 #27c93f;
}

.terminal-body {
    padding: 1.5rem;
    font-size: 0.9rem;
}

.line {
    margin-bottom: 0.5rem;
    color: #e2e8f0;
}

.line.warning {
    color: var(--accent-warning);
}

.line.info {
    color: var(--accent-cyan);
}

.prompt {
    color: var(--accent-success);
    margin-right: 0.5rem;
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.research-card {
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.research-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.15);
}

.blueprint-bg {
    height: 140px;
    background: linear-gradient(45deg, var(--bg-surface), #1e293b);
    position: relative;
}

.blueprint-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 16px 16px;
    opacity: 0.5;
}

.card-content {
    padding: 1.5rem;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.read-more::after {
    content: '→';
    transition: transform 0.2s;
}

.research-card:hover .read-more::after {
    transform: translateX(4px);
}

footer {
    background: #020617;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 5rem 0 3rem;
    color: var(--text-secondary);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

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

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 0.2;
    }

    50% {
        opacity: 1;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero-grid,
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero {
        padding-top: 120px;
        text-align: center;
    }

    .hero-cta {
        flex-direction: column;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .navbar {
        padding: 0.5rem 0;
    }

    .nav-links {
        display: none;
    }

    .feature-grid.reverse {
        direction: ltr;
        grid-template-areas: "content" "visual";
    }
}