:root {
    --bg-dark: #05050A;
    --bg-card: #0F121E;
    --primary: #6366f1;
    --accent: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --gradient-main: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --border-color: rgba(255, 255, 255, 0.1);
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

section {
    padding: 5rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Utility */
.text-gradient {
    /* Create a seamless gradient for looping: Primary -> Accent -> Primary */
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #6366f1 100%);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    animation: gradientMove 6s linear infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--gradient-main);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

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

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

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

/* 0. NAVBAR */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(5, 5, 10, 0.85);
    /* Slightly darker for mobile readability */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 0;
    transition: var(--transition);
}

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

.logo {
    font-family: 'Michroma', sans-serif;
    font-weight: 400;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1001;
    /* Above mobile menu */
}

.menu-toggle {
    display: none;
    cursor: pointer;
    z-index: 1001;
}

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

.nav-link {
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: var(--transition);
}

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

/* 1. HERO SECTION */
.hero {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 6rem;
    /* Increased for mobile navbar safety */
    position: relative;
    padding-left: 1rem;
    padding-right: 1rem;
    overflow: hidden;
}

/* Hero Canvas Animation */
.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: block;
}

.hero h1,
.hero p,
.hero-actions,
.live-activity {
    position: relative;
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(5, 5, 10, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    max-width: 800px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* LIVE ACTIVITY WIDGET */
.live-activity {
    margin-top: 3rem;
    background: rgba(15, 18, 30, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 1rem;
    width: 100%;
    max-width: 450px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
}

.live-activity::before {
    content: 'LIVE SYSTEM LOGS';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-size: 0.7rem;
    padding: 0.3rem 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.log-container {
    margin-top: 1.5rem;
    height: 120px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.log-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(-10px);
    animation: slideInLog 0.3s forwards;
}

.log-time {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    /* Prevent time wrapping */
}

.log-status {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-ok {
    background-color: #22c55e;
    box-shadow: 0 0 5px #22c55e;
}

.status-warn {
    background-color: #eab308;
    box-shadow: 0 0 5px #eab308;
}

.status-crit {
    background-color: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

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

/* 2. PROBLEM SECTION */
.problem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 12px;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.3);
}

.card-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

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

.section-header p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* SPOTLIGHT EFFECT */
.card,
.capability-card {
    position: relative;
    overflow: hidden;
}

.card::before,
.capability-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y),
            rgba(255, 255, 255, 0.04),
            transparent 40%);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover::before,
.capability-card:hover::before {
    opacity: 1;
}

/* 3. HOW IT WORKS (Flowchart) */
.flow-container {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
    overflow-x: auto;
    padding-bottom: 2rem;
    /* Hide scrollbar for clean look but allow scroll */
    scrollbar-width: none;
}

.flow-container::-webkit-scrollbar {
    display: none;
}

.flow-step {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 12px;
    flex: 1;
    min-width: 200px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flow-step h3 {
    margin: 1rem 0 0.5rem;
    font-size: 1.1rem;
}

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

.flow-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.5rem;
}

.flow-icon-wrapper {
    width: 60px;
    height: 60px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* 4. CAPABILITIES */
.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.capability-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.capability-icon {
    color: var(--primary);
    font-size: 1.5rem;
    margin-top: 0.2rem;
}

/* 5. SECURITY */
.security-section {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-dark) 100%);
    border-radius: 20px;
    padding: 4rem 2rem;
    margin-top: 2rem;
}

.security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* 6. AUDIENCE */
.audience-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.audience-tag {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.audience-tag:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

/* 7. DOCS SECTION */
.docs-cta {
    text-align: center;
    padding: 6rem 0;
}

/* 8. FOOTER */
footer {
    border-top: 1px solid var(--border-color);
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-brand {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* ANIMATION UTILS */
.fade-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-on-scroll.appear {
    opacity: 1;
    transform: translateY(0);
}

/* --- RESPONSIVE / MOBILE STYLE --- */
@media (max-width: 768px) {

    /* Navbar Mobile */
    .logo {
        font-family: 'Michroma', sans-serif !important;
        font-weight: 400;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        background: rgba(5, 5, 10, 0.95);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        padding: 2rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        transform: translateY(-20px);
        opacity: 0;
        pointer-events: none;
        transition: var(--transition);
        gap: 1.5rem;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    /* Hero Tweaks */
    .hero {
        padding-top: 8rem;
    }

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

    .hero p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    /* Live Activity Mobile */
    .live-activity {
        margin-top: 2rem;
        font-size: 0.75rem;
        /* Smaller text on mobile */
    }

    /* Flowchart Vertical */
    .flow-container {
        flex-direction: column;
        align-items: center;
    }

    .flow-arrow {
        transform: rotate(90deg);
        margin: 0.5rem 0;
    }

    .flow-step {
        width: 100%;
    }

    /* General Padding */
    section {
        padding: 3rem 1rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }
}