/* Modern CSS Reset & Variable Tokens */
:root {
    --bg-dark: #07080d;
    --bg-card: rgba(18, 22, 33, 0.6);
    --bg-card-hover: rgba(26, 32, 48, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(59, 130, 246, 0.3);
    
    --primary: #3b82f6; /* Electric Blue */
    --secondary: #10b981; /* Neon Emerald */
    --accent: #8b5cf6; /* Cyber Purple */
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-glow: 0 0 10px rgba(59, 130, 246, 0.5);
    
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Background Gradients & Grid */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background: 
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(16, 115, 129, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* Global Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography & Headers */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 20px;
}

h2 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.2;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

p {
    color: var(--text-muted);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.accent-text {
    color: var(--secondary);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* Header & Nav */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    background-color: rgba(7, 8, 13, 0.7);
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--primary);
    animation: rotateWind 10s linear infinite;
}

@keyframes rotateWind {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

nav {
    display: flex;
    gap: 32px;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

nav a:hover {
    color: var(--text-main);
    text-shadow: var(--text-glow);
}

.github-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 9999px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.github-nav-btn:hover {
    border-color: var(--border-hover);
    background-color: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #000;
    border: none;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2.5px);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background-color: var(--bg-card-hover);
    transform: translateY(-2.5px);
}

/* Badge styling */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #60a5fa;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge i {
    animation: flash 2s infinite;
}

@keyframes flash {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Hero Section */
.hero {
    padding: 100px 0 120px 0;
    position: relative;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
}

.hero-text p {
    font-size: 1.15rem;
    margin-bottom: 36px;
    max-width: 580px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

/* Simulator Card (Telegram Simulator) */
.simulator-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    height: 520px;
    transition: var(--transition-smooth);
}

.simulator-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 30px 60px rgba(59, 130, 246, 0.15);
}

.simulator-header {
    background: rgba(13, 17, 26, 0.8);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.simulator-header .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.simulator-header .dot.red { background-color: #ef4444; }
.simulator-header .dot.yellow { background-color: #eab308; }
.simulator-header .dot.green { background-color: #10b981; }

.simulator-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.simulator-title i {
    color: #38bdf8;
}

.simulator-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: radial-gradient(circle at top, rgba(13, 17, 26, 0.5) 0%, transparent 100%);
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.message.system {
    align-self: center;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 8px 16px;
    border-radius: 20px;
    max-width: 100%;
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message.bot {
    align-self: flex-start;
    background-color: rgba(30, 41, 59, 0.7);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 4px;
}

.ascii-cloud {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 8px;
    margin-top: 10px;
    overflow-x: auto;
    white-space: pre;
    color: #38bdf8;
    line-height: 1.25;
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.simulator-input-area {
    padding: 16px 20px;
    background-color: rgba(13, 17, 26, 0.8);
    border-top: 1px solid var(--border-color);
}

.quick-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.quick-chips::-webkit-scrollbar {
    height: 3px;
}

.quick-chips button {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: var(--font-body);
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.quick-chips button:hover {
    color: var(--text-main);
    border-color: var(--border-hover);
    background-color: rgba(59, 130, 246, 0.1);
}

.input-row {
    display: flex;
    gap: 10px;
}

.input-row input {
    flex: 1;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 12px;
    outline: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.input-row input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.input-row button {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: #000;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.input-row button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* Features Section */
.features {
    padding: 120px 0;
    position: relative;
    border-top: 1px solid var(--border-color);
}

.section-title {
    margin-bottom: 64px;
}

.section-title h2 {
    margin-bottom: 16px;
}

.section-title p {
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto;
}

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

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

.feature-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 36px;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    background-color: var(--bg-card-hover);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--secondary);
}

.feature-card h3 {
    font-size: 1.3rem;
}

/* Architecture Section */
.architecture-sec {
    padding: 120px 0;
    background: linear-gradient(to bottom, transparent, rgba(13, 17, 26, 0.4), transparent);
    border-top: 1px solid var(--border-color);
}

.architecture-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.flow-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 36px;
}

.flow-step {
    display: flex;
    gap: 20px;
}

.step-num {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.flow-step h4 {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

/* Architecture Visual Node Diagram */
.arch-visual {
    position: relative;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.visual-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.network-node {
    position: absolute;
    padding: 16px 24px;
    border-radius: 16px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 2;
    transition: var(--transition-smooth);
    width: 160px;
    text-align: center;
}

.network-node i {
    font-size: 1.8rem;
}

.network-node span {
    font-size: 0.85rem;
    font-weight: 600;
}

.network-node.central-hub {
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.network-node.central-hub i { color: var(--primary); }

.network-node.node-client {
    bottom: 10%;
    left: 10%;
}
.network-node.node-client i { color: var(--secondary); }

.network-node.node-tg {
    top: 10%;
    right: 10%;
}
.network-node.node-tg i { color: #38bdf8; }

.network-node:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.connection-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
    z-index: 1;
    height: 2px;
    transform-origin: 0 0;
}

.connection-line.line-1 {
    top: 25%;
    left: 35%;
    width: 25%;
    transform: rotate(40deg);
}

.connection-line.line-2 {
    top: 45%;
    left: 52%;
    width: 28%;
    transform: rotate(-35deg);
}

/* Interactive Terminal Section */
.demo-sec {
    padding: 120px 0;
    border-top: 1px solid var(--border-color);
}

.terminal-container {
    background-color: #0b0c10;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    max-width: 800px;
    margin: 0 auto;
    height: 480px;
    display: flex;
    flex-direction: column;
    font-family: var(--font-mono);
}

.terminal-header {
    background-color: #12131a;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.terminal-header .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-header .dot.red { background-color: #ef4444; }
.terminal-header .dot.yellow { background-color: #eab308; }
.terminal-header .dot.green { background-color: #10b981; }

.terminal-title {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 8px;
}

.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    color: #34d399; /* Green text for matrix/terminal feel */
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.term-line {
    word-break: break-all;
    white-space: pre-wrap;
}

.term-line.welcome {
    color: var(--text-main);
    font-weight: 600;
}

.term-line.error {
    color: #ef4444;
}

.term-line.info {
    color: #38bdf8;
}

.prompt-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.prompt-prefix {
    color: #38bdf8;
    flex-shrink: 0;
}

.prompt-line input {
    flex: 1;
    background-color: transparent;
    border: none;
    outline: none;
    color: #34d399;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* Deploy / Setup Section */
.setup-sec {
    padding: 120px 0;
    border-top: 1px solid var(--border-color);
}

.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 48px;
}

.setup-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.code-block {
    background-color: #0b0c10;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 18px;
    border-radius: 12px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #e2e8f0;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.5;
}

.setup-note {
    margin-top: 48px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.setup-note i {
    color: var(--primary);
    margin-right: 6px;
}

/* Footer Section */
footer {
    padding: 60px 0;
    border-top: 1px solid var(--border-color);
    background-color: #050609;
}

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

.footer-container p {
    font-size: 0.9rem;
}

.footer-container a {
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition-smooth);
}

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

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

/* Responsive Rules */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 64px;
        text-align: center;
    }
    
    .hero-text p {
        margin: 0 auto 36px auto;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .architecture-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    
    .arch-visual {
        order: -1;
        height: 300px;
    }
    
    .setup-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-container {
        height: 70px;
    }
    
    nav {
        display: none; /* simple responsive choice, burger can be added if needed */
    }
    
    .footer-container {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}
