/* ===================================
   Design System & CSS Variables
   =================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    /* Colors - improved contrast */
    --bg: #050508;
    --bg-card: rgba(255, 255, 255, 0.03);
    --fg: #f0f0f5;
    --text-main: #f5f5f7;
    --text-muted: #a0a0b0;
    --edge: rgba(255, 255, 255, 0.08);
    --accent: #6366f1;
    --accent-2: #a855f7;
    --accent-3: #3b82f6;

    /* Spacing System (8px base) */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-2xl: 64px;

    /* Typography Scale */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.7;
    --line-height-tight: 1.2;
    --line-height-relaxed: 1.8;

    /* Border Radius */
    --radius: 20px;
    --radius-sm: 12px;
    --radius-lg: 24px;

    /* Layout */
    --container-max-width: 1140px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===================================
   Base Styles
   =================================== */
html {
    scroll-behavior: smooth;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--text-main);
    background: var(--bg);
    font: 400 var(--font-size-base)/var(--line-height-base) var(--font-family);
    padding-bottom: var(--safe-bottom);
    overflow-x: hidden;
}

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

/* ===================================
   Animated Gradient Background
   =================================== */
.bg-aurora {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background: var(--bg);
}

.bg-aurora::before,
.bg-aurora::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.bg-aurora::before {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    top: -20%;
    left: -10%;
    animation-delay: 0s;
}

.bg-aurora::after {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent-2) 0%, transparent 70%);
    bottom: -15%;
    right: -10%;
    animation-delay: -10s;
}

.bg-aurora .orb {
    position: absolute;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, var(--accent-3) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(5%, 10%) scale(1.05);
    }

    50% {
        transform: translate(-5%, 5%) scale(0.95);
    }

    75% {
        transform: translate(3%, -8%) scale(1.02);
    }
}

/* Subtle noise overlay */
.bg-noise {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* ===================================
   Layout Container
   =================================== */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.page-content {
    padding-top: calc(var(--space-2xl) + 60px);
    padding-bottom: var(--space-md);
}

/* ===================================
   Navigation
   =================================== */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(5, 5, 8, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--edge);
}

.nav-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
}

.nav-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.nav-link.active {
    color: var(--accent);
}

/* ===================================
   Brand
   =================================== */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: conic-gradient(from 120deg, var(--accent), var(--accent-2), var(--accent));
    animation: spin 4s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===================================
   Typography
   =================================== */
.h1 {
    font-size: clamp(36px, 8vw, 64px);
    line-height: var(--line-height-tight);
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--fg) 0%, var(--accent) 50%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 600;
    margin: 8px 0 0;
    color: var(--fg);
    opacity: 0.9;
}

.lead {
    margin: 20px 0 0;
    color: var(--text-muted);
    font-size: clamp(15px, 2vw, 17px);
    max-width: 600px;
    line-height: var(--line-height-relaxed);
}

.section-title {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 800;
    margin: var(--space-2xl) 0 var(--space-lg);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===================================
   Hero Section
   =================================== */
.hero {
    padding: clamp(48px, 10vw, 100px) 0 clamp(32px, 8vw, 64px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Terminal-style badge */
.cmd {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    font-family: 'SF Mono', ui-monospace, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
}

.cmd::before {
    content: '$';
    opacity: 0.5;
}

.caret::after {
    content: "▌";
    animation: blink 1s steps(1, end) infinite;
    color: var(--accent-2);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* ===================================
   Buttons & CTAs
   =================================== */
.btn,
.tg-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 36px;
    padding: 14px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow:
        0 0 20px rgba(99, 102, 241, 0.4),
        0 0 60px rgba(168, 85, 247, 0.2);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    border: none;
}

.btn:hover,
.tg-link:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 0 30px rgba(99, 102, 241, 0.5),
        0 0 80px rgba(168, 85, 247, 0.3);
}

.tg-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tg-icon svg {
    width: 100%;
    height: 100%;
    fill: #fff;
}

/* ===================================
   Cards Grid
   =================================== */
.grid {
    display: grid;
    gap: 20px;
    margin-top: var(--space-xl);
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    padding: var(--space-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(135deg, transparent 0%, rgba(99, 102, 241, 0) 50%, rgba(168, 85, 247, 0.3) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.card:hover::before {
    opacity: 1;
}

.card-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    flex-shrink: 0;
}

.card h3 {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 600;
    color: var(--fg);
}

.card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
}

/* ===================================
   Bot Detailed Card
   =================================== */
.bot-card {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--edge);
    border-radius: calc(var(--radius) * 1.5);
    padding: clamp(24px, 5vw, 48px);
    margin-top: 40px;
    margin-bottom: 80px;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.bot-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.05);
}

.bot-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 40px;
}

.bot-title-group {
    flex: 1;
    min-width: 280px;
}

.bot-title-group h2 {
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 800;
    margin: 0 0 12px;
    line-height: var(--line-height-tight);
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bot-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    border-radius: 100px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    margin-bottom: 16px;
}

.bot-overview {
    font-size: clamp(16px, 2vw, 18px);
    color: var(--fg);
    opacity: 0.9;
    line-height: 1.6;
    max-width: 800px;
}

.bot-content {
    display: grid;
    gap: 48px;
    grid-template-columns: 1.6fr 1fr;
}

.bot-features h3,
.bot-sidebar h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.feature-grid {
    display: grid;
    gap: 28px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.feature-item {
    display: flex;
    gap: 16px;
}

.feature-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--accent);
}

.feature-text h4 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
    color: var(--fg);
}

.feature-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-muted);
}

.bot-sidebar {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.sidebar-block {
    background: rgba(255, 255, 255, 0.02);
    padding: var(--space-md);
    border-radius: var(--radius);
    border: 1px solid var(--edge);
}

.sidebar-block h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-2);
    margin: 0 0 20px;
    font-weight: 700;
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.4;
}

.sidebar-list li::before {
    content: '⚡';
    position: absolute;
    left: 0;
    font-size: 12px;
    opacity: 0.7;
}

.bot-footer {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--edge);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}

.deployment-info {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===================================
   View Management
   =================================== */
.view-section {
    display: none;
}

.view-section.active {
    display: block;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    transition: color 0.3s ease;
    cursor: pointer;
}

.back-btn:hover {
    color: var(--fg);
}

/* ===================================
   Footer
   =================================== */
footer {
    margin: var(--space-2xl) 0 var(--space-md);
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    opacity: 0.7;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 960px) {
    .bot-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    :root {
        --space-md: 16px;
    }

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

    .lead {
        margin-left: auto;
        margin-right: auto;
    }

    .tg-link,
    .btn {
        width: 100%;
        justify-content: center;
    }

    .bot-card {
        padding: var(--space-md);
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        gap: var(--space-sm);
    }
}

/* ===================================
   Utility Classes
   =================================== */
.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.bg-accent-soft {
    background: rgba(99, 102, 241, 0.03);
}

.border-accent {
    border-color: rgba(168, 85, 247, 0.2);
}

.text-sm {
    font-size: 14px;
}

.text-xs {
    font-size: 13px;
}

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

.flex {
    display: flex;
}

.gap-sm {
    gap: var(--space-sm);
}

.grid-2 {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 640px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.gradient-bg {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), transparent);
}