:root {
    --bg: #050505;
    --text: #ffffff;
    --text-dim: #888888;
    --border: #222222;
    --card-bg: #0a0a0a;
    --accent: #ffffff;
    --glass: rgba(255, 255, 255, 0.03);
    --font-main: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Шум для текстуры */
.noise-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* HEADER */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 0;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

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

.logo {
    font-size: 24px;
    letter-spacing: -1px;
}

.logo .bold { font-weight: 800; }

.nav a {
    margin: 0 15px;
    font-size: 14px;
    color: var(--text-dim);
    font-weight: 500;
}

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

/* BUTTONS */
.btn {
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: none;
}

.btn-outline {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--text);
    background: var(--text);
    color: var(--bg);
}

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

.btn-solid:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
}

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

.btn-text {
    color: var(--text-dim);
    border-bottom: 1px solid transparent;
}

.btn-text:hover {
    color: var(--text);
    border-bottom-color: var(--text);
}

/* HERO */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding-top: 60px;
}

.hero-text {
    z-index: 2;
    position: relative;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 11px;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: var(--text-dim);
}

h1 {
    font-size: 64px;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -2px;
}

.outlined-text {
    color: transparent;
    -webkit-text-stroke: 1px var(--text-dim);
}

.subtitle {
    color: var(--text-dim);
    font-size: 18px;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-btns {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
}

/* GRID BG */
.grid-background {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.1;
    z-index: 1;
    mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
}

/* TICKER */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    background: var(--text);
    color: var(--bg);
    padding: 15px 0;
    white-space: nowrap;
    border-top: 1px solid var(--text);
    border-bottom: 1px solid var(--text);
}

.ticker {
    display: inline-block;
    animation: ticker 20s linear infinite;
}

.ticker-item {
    display: inline-block;
    padding: 0 40px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
}

@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

/* SECTIONS */
.section {
    padding: 100px 0;
}

.section-title {
    font-size: 36px;
    margin-bottom: 60px;
    letter-spacing: -1px;
}

/* BENTO GRID */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 40px;
    border-radius: 12px;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: var(--text-dim);
    transform: translateY(-5px);
}

.card-icon {
    margin-bottom: 20px;
    color: var(--text);
    width: 32px; height: 32px;
}

.card h3 {
    margin-bottom: 10px;
    font-size: 20px;
}

.card p {
    color: var(--text-dim);
    font-size: 14px;
}

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

/* MODELS SPLIT */
.split-layout {
    display: flex;
    gap: 60px;
    align-items: center;
}

.split-text { flex: 1; }

.check-list li {
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dim);
}

.check-list b { color: var(--text); }

.model-cards {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.model-row {
    display: flex;
    gap: 20px;
}

.model-row:nth-child(2) { margin-left: 40px; }

.model-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 20px 40px;
    border-radius: 8px;
    min-width: 180px;
    text-align: center;
    position: relative;
}

.model-card.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.model-card .status {
    position: absolute;
    top: -10px; right: -10px;
    background: #fff;
    color: #000;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

/* MARKET */
.center-text { text-align: center; display: flex; flex-direction: column; align-items: center; }
.max-w-600 { max-width: 600px; color: var(--text-dim); margin-bottom: 40px; }

.market-preview {
    display: flex;
    gap: 20px;
    width: 100%;
}

.market-item {
    flex: 1;
    border: 1px solid var(--border);
    padding: 30px;
    text-align: left;
    border-radius: 8px;
    transition: 0.3s;
}

.market-item:hover { border-color: var(--text); }

.market-item.highlight {
    background: rgba(255,255,255,0.05);
    border-color: var(--text-dim);
}

.m-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.m-desc {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 20px;
}

.btn-small {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 5px 15px;
    font-size: 12px;
    cursor: pointer;
    width: 100%;
    transition: 0.2s;
}

.btn-small:hover { background: var(--text); color: var(--bg); }

/* REFERRAL */
.referral-box {
    background: var(--text);
    color: var(--bg);
    border-radius: 20px;
    padding: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ref-content h2 { font-size: 80px; line-height: 1; letter-spacing: -4px; }
.ref-content h3 { font-size: 32px; margin-bottom: 20px; }
.ref-content p { max-width: 400px; margin-bottom: 30px; opacity: 0.8; }

/* FOOTER */
.footer {
    padding: 60px 0;
    border-top: 1px solid var(--border);
}

.footer-row {
    display: flex;
    justify-content: space-between;
}

.f-col h4 { margin-bottom: 20px; font-size: 14px; text-transform: uppercase; color: var(--text-dim); }
.f-col a { display: block; margin-bottom: 10px; color: var(--text); font-size: 14px; }
.f-col a:hover { color: var(--text-dim); }
.copyright { color: var(--text-dim); font-size: 12px; margin-top: 20px; }

/* ======================= CHAT MODAL ======================= */
.chat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.chat-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.chat-container {
    width: 90%;
    max-width: 900px;
    height: 80vh;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.4s ease-out;
}

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

.chat-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-small {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.logo-small .bold {
    font-weight: 800;
}

.model-selector select {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font-main);
    cursor: pointer;
    outline: none;
    transition: 0.2s;
}

.model-selector select:hover {
    border-color: var(--text-dim);
}

.chat-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.requests-counter {
    font-size: 13px;
    color: var(--text-dim);
}

.requests-counter b {
    color: var(--text);
    font-size: 16px;
}

.close-chat-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.close-chat-btn:hover {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--bg);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

.welcome-message {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
}

.welcome-message h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.welcome-message p {
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 10px;
}

.welcome-message .hint {
    font-size: 13px;
    color: var(--text-dim);
    opacity: 0.7;
}

.message {
    display: flex;
    gap: 15px;
    animation: messageIn 0.3s ease-out;
}

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

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--text);
    color: var(--bg);
}

.message-content {
    max-width: 70%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 15px 20px;
    border-radius: 12px;
    line-height: 1.6;
    font-size: 14px;
}

.message.user .message-content {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.message-content p {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-dim);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

.chat-input-area {
    padding: 20px 30px;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

#chatInput {
    flex: 1;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 14px;
    resize: none;
    outline: none;
    min-height: 48px;
    max-height: 150px;
    transition: 0.2s;
}

#chatInput:focus {
    border-color: var(--text-dim);
}

.send-btn {
    background: var(--text);
    color: var(--bg);
    border: 1px solid var(--text);
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.limit-reached-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--text);
    color: var(--bg);
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    z-index: 10001;
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.limit-reached-modal h3 {
    font-size: 24px;
    margin-bottom: 15px;
}

.limit-reached-modal p {
    margin-bottom: 25px;
    opacity: 0.9;
}

.limit-reached-modal .btn {
    width: 100%;
    justify-content: center;
}

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

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    h1 { font-size: 40px; }
    .bento-grid { grid-template-columns: 1fr; }
    .span-2, .span-3 { grid-column: span 1; }
    .split-layout { flex-direction: column; }
    .model-row { margin-left: 0 !important; justify-content: center; }
    .market-preview { flex-direction: column; }
    .referral-box { flex-direction: column; text-align: center; padding: 40px 20px; }
    .ref-visual { display: none; }
    .footer-row { flex-direction: column; gap: 40px; }
    .nav { display: none; }
    
    .chat-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .chat-header {
        padding: 15px 20px;
    }
    
    .chat-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .chat-input-area {
        padding: 15px 20px;
    }
}
