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

:root {
    --primary-color: #f59e0b;
    --secondary-color: #f97316;
    --accent-color: #ec4899;
    --dark-bg: #0a0e27;
    --darker-bg: #050814;
    --card-bg: rgba(30, 41, 59, 0.5);
    --card-hover-bg: rgba(30, 41, 59, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(148, 163, 184, 0.1);
    --success-color: #10b981;
    --gradient: linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #ec4899 100%);
    --gradient-hover: linear-gradient(135deg, #d97706 0%, #ea580c 50%, #db2777 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(245, 158, 11, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(249, 115, 22, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 14, 39, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(10, 14, 39, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.github-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.github-link:hover {
    background: var(--card-hover-bg);
    border-color: var(--primary-color);
}

.github-icon {
    width: 20px;
    height: 20px;
}

/* Hero Section */
.hero {
    padding: 8rem 0 4rem;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Architecture Section */
.architecture-section {
    padding: 2rem 0 4rem;
}

.intro-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 3rem;
}

.intro-card h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.intro-card p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.intro-card strong {
    color: var(--primary-color);
}

/* Diagram Section */
.diagram-section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Flow Diagram Styles */
.flow-diagram {
    background: var(--darker-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.flow-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 2rem;
}

.flow-row.center-row {
    margin: 0;
}

.flow-node {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    min-width: 280px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.flow-node:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(245, 158, 11, 0.3);
}

.node-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.5));
    display: flex;
    justify-content: center;
    align-items: center;
}

.tech-logo {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.3));
}

.node-label {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.node-tech {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.node-detail {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Node Type Specific Colors */
.client-node {
    border-color: rgba(148, 163, 184, 0.3);
}

.api-node {
    border-color: rgba(96, 165, 250, 0.5);
    background: rgba(96, 165, 250, 0.05);
}

.api-node:hover {
    border-color: rgba(96, 165, 250, 0.8);
    box-shadow: 0 10px 40px rgba(96, 165, 250, 0.3);
}

.redis-node {
    border-color: rgba(248, 113, 113, 0.5);
    background: rgba(248, 113, 113, 0.05);
}

.redis-node:hover {
    border-color: rgba(248, 113, 113, 0.8);
    box-shadow: 0 10px 40px rgba(248, 113, 113, 0.3);
}

.db-node {
    border-color: rgba(52, 211, 153, 0.5);
    background: rgba(52, 211, 153, 0.05);
}

.db-node:hover {
    border-color: rgba(52, 211, 153, 0.8);
    box-shadow: 0 10px 40px rgba(52, 211, 153, 0.3);
}

.keda-node {
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.05);
}

.keda-node:hover {
    border-color: rgba(251, 191, 36, 0.8);
    box-shadow: 0 10px 40px rgba(251, 191, 36, 0.3);
}

.worker-node {
    border-color: rgba(251, 146, 60, 0.5);
    background: rgba(251, 146, 60, 0.05);
}

.worker-node:hover {
    border-color: rgba(251, 146, 60, 0.8);
    box-shadow: 0 10px 40px rgba(251, 146, 60, 0.3);
}

.qm-node {
    border-color: rgba(236, 72, 153, 0.5);
    background: rgba(236, 72, 153, 0.05);
}

.qm-node:hover {
    border-color: rgba(236, 72, 153, 0.8);
    box-shadow: 0 10px 40px rgba(236, 72, 153, 0.3);
}

/* Flow Arrows */
.flow-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1rem 0;
    position: relative;
}

.arrow-line {
    width: 2px;
    height: 40px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    position: relative;
}

.arrow-line::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 12px solid var(--secondary-color);
}

.flow-arrow.vertical .arrow-line {
    height: 30px;
}

.flow-arrow.bidirectional .arrow-line::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 12px solid var(--primary-color);
}

.arrow-label {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--darker-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    border: 1px solid var(--border-color);
    font-weight: 500;
}

/* Flow Split (for parallel branches) */
.flow-split {
    display: flex;
    justify-content: center;
    gap: 4rem;
    width: 100%;
    margin: 1rem 0;
}

.split-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* KEDA-specific styling for dashed lines */
.keda-line {
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    background-image: repeating-linear-gradient(
        0deg,
        var(--primary-color),
        var(--primary-color) 5px,
        transparent 5px,
        transparent 10px
    );
}

.keda-label {
    background: var(--darker-bg);
    border: 1px dashed var(--primary-color) !important;
}

/* Flow note */
.flow-note {
    margin-top: 2rem;
    padding: 1rem 1.5rem;
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--primary-color);
    border-radius: 0.5rem;
}

.flow-note p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.flow-note code {
    background: var(--darker-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    color: var(--primary-color);
    font-family: 'JetBrains Mono', monospace;
}

/* Components Section */
.components-section {
    margin-bottom: 4rem;
}

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

.component-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.3s ease;
}

.component-card:hover {
    background: var(--card-hover-bg);
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.component-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.component-icon {
    font-size: 2.5rem;
}

.component-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.component-tech {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tech-badge {
    padding: 0.25rem 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 600;
}

.component-features {
    list-style: none;
    margin-bottom: 1.5rem;
}

.component-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.component-features li:last-child {
    border-bottom: none;
}

.component-features strong {
    color: var(--text-primary);
}

.component-k8s {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--darker-bg);
    border-radius: 0.5rem;
}

.component-k8s code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--accent-color);
}



/* Fault Tolerance Section */
.fault-section {
    margin-bottom: 4rem;
}

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

.fault-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
}

.fault-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.fault-detection,
.fault-recovery {
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.fault-detection {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.fault-recovery {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.fault-detection .label,
.fault-recovery .label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.fault-detection .label {
    color: #ef4444;
}

.fault-recovery .label {
    color: #10b981;
}



/* Footer */
.footer {
    background: var(--darker-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

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

.footer p {
    color: var(--text-secondary);
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--secondary-color);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .components-grid,
    .fault-grid {
        grid-template-columns: 1fr;
    }

    .footer .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .flow-split {
        flex-direction: column;
        gap: 1rem;
    }

    .flow-node {
        min-width: 100%;
    }

    .arrow-label {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }

    .flow-diagram {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero {
        padding: 6rem 0 3rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .nav-container {
        padding: 1rem;
    }

    .github-link span {
        display: none;
    }
}
