@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --bg: #070708;
    --card: #0f0f12;
    --primary: #00f2ff;
    --secondary: #7000ff;
    --accent: #39ff14;
    --text: #e2e8f0;
    --text-muted: #64748b;
    --border: rgba(255, 255, 255, 0.04);
    --grid-color: rgba(0, 242, 255, 0.035);
}

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

html {
    scroll-behavior: smooth;
}

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

/* --- Dynamic Tech Background Layering --- */

/* Primary Grid - High Density */
.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    z-index: -3;
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center center;
    animation: gridDriftPrimary 80s linear infinite;
    pointer-events: none;
    will-change: transform;
}

/* Secondary Grid - Parallax Depth */
.background-grid.secondary {
    z-index: -4;
    background-image: 
        linear-gradient(rgba(112, 0, 255, 0.02) 2px, transparent 2px),
        linear-gradient(90deg, rgba(112, 0, 255, 0.02) 2px, transparent 2px);
    background-size: 150px 150px;
    animation: gridDriftSecondary 120s linear infinite reverse;
    opacity: 0.5;
}

/* Subtle tech overlay with random pulses */
.tech-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-image: radial-gradient(circle at 50% 50%, rgba(0, 242, 255, 0.05) 1px, transparent 1px);
    background-size: 100px 100px;
    animation: overlayPulse 10s ease-in-out infinite;
    pointer-events: none;
}

@keyframes gridDriftPrimary {
    0% { transform: translate(-25%, -25%); }
    100% { transform: translate(0%, 0%); }
}

@keyframes gridDriftSecondary {
    0% { transform: translate(0%, 0%) scale(1); }
    100% { transform: translate(-25%, -25%) scale(1.1); }
}

@keyframes overlayPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* Subtler Scanlines with Digital Grain */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.1) 50%
    );
    background-size: 100% 4px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.15;
}

/* Vignette for Cinematic Focus */
.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
}

/* --- Reveal Animations --- */

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

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

.mono { font-family: 'JetBrains Mono', monospace; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.py-32 { padding-top: 8rem; padding-bottom: 8rem; }

/* --- Components --- */

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7, 7, 8, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: 80px;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--bg);
    padding: 4px 8px;
    border-radius: 8px;
    font-weight: 700;
    font-family: 'JetBrains Mono';
}

.logo-icon-small {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--bg);
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.6rem;
    font-family: 'JetBrains Mono';
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.logo span { color: var(--primary); }

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

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s;
}

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

.divider {
    width: 1px;
    height: 20px;
    background: var(--border);
}

.online-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.03);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.pulse-dot.green { background: var(--accent); }

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 242, 255, 0.4); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0, 242, 255, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 242, 255, 0); }
}

/* Hero */
.hero {
    position: relative;
    padding: 6rem 0;
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
}

.glow-blob {
    position: absolute;
    width: 500px;
    height: 500px;
    background: var(--primary);
    filter: blur(150px);
    opacity: 0.08;
    z-index: -1;
    animation: blobFloat 25s ease-in-out infinite alternate;
}

.top-right { top: -200px; right: -100px; }
.bottom-left { bottom: -200px; left: -100px; animation-delay: -10s; background: var(--secondary); }

@keyframes blobFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(80px, 40px) scale(1.2); }
    100% { transform: translate(-40px, 80px) scale(0.9); }
}

.badge {
    display: inline-block;
    padding: 4px 16px;
    background: rgba(0, 242, 255, 0.07);
    border: 1px solid rgba(0, 242, 255, 0.15);
    border-radius: 20px;
    color: var(--primary);
    font-family: 'JetBrains Mono';
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1.5rem;
}

.main-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 242, 255, 0.15);
}

.hero-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 3.5rem;
}

/* TOS Card */
.tos-card {
    max-width: 480px;
    margin: 0 auto;
    background: var(--card);
    padding: 2.5rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.tos-container {
    padding: 1.25rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
    background: rgba(255,255,255,0.015);
    text-align: left;
    border: 1px solid transparent;
}

.tos-container.error-state {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.checkbox-label {
    display: flex;
    gap: 1.25rem;
    cursor: pointer;
}

.checkbox-label input { display: none; }

.custom-checkbox {
    min-width: 22px;
    height: 22px;
    border: 2px solid #2d2d35;
    border-radius: 6px;
    position: relative;
    transition: 0.2s;
    margin-top: 4px;
}

.checkbox-label input:checked + .custom-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input:checked + .custom-checkbox::after {
    content: '✓';
    position: absolute;
    color: var(--bg);
    font-size: 14px;
    font-weight: 900;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-text .primary-text { font-weight: 600; font-size: 0.9rem; color: #f1f5f9; }
.checkbox-text .secondary-text { font-size: 0.75rem; color: #64748b; margin-top: 4px; }

.error-hidden { display: none; }
.error-visible {
    display: block;
    color: #ef4444;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-top: 1rem;
    animation: shake 0.5s;
    letter-spacing: 0.05em;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Cyber Button */
.cyber-button {
    width: 100%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    padding: 1px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.btn-text {
    display: block;
    background: var(--bg);
    padding: 1.125rem 2rem;
    border-radius: 30px;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: 0.3s;
}

.cyber-button:hover .btn-text {
    background: transparent;
    color: var(--bg);
}

.btn-shimmer {
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.7s;
}

.cyber-button:hover .btn-shimmer { left: 100%; }

/* Sections */
.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-header h2 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; letter-spacing: -0.02em; }
.section-header p { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

.mechanics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
}

.mechanic-step {
    position: relative;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.step-num {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 1rem;
    display: block;
}

.mechanic-step h3 { font-size: 1.2rem; margin-bottom: 0.75rem; }
.mechanic-step p { font-size: 0.9rem; color: var(--text-muted); }

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

.feature-card {
    background: var(--card);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    transition: 0.3s ease;
}

.feature-card:hover { 
    border-color: rgba(0, 242, 255, 0.2); 
    transform: translateY(-5px);
}

.feature-card .icon { font-size: 2rem; margin-bottom: 1.5rem; display: block; }
.feature-card h3 { font-size: 1.25rem; margin-bottom: 1rem; }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; }

/* Comparison Table */
.comparison-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
}

.card-header { padding: 3rem; border-bottom: 1px solid var(--border); }

.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 1.5rem 2rem; border-bottom: 1px solid var(--border); }
th { font-family: 'JetBrains Mono'; font-size: 0.7rem; color: #475569; text-transform: uppercase; letter-spacing: 0.1em; }
.highlight { color: var(--primary); font-weight: 700; }
td { font-size: 0.95rem; }
tr:hover td { background: rgba(255,255,255,0.01); }

/* FAQ */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }

.faq-toggle {
    width: 100%;
    padding: 1.5rem 0;
    background: none;
    border: none;
    color: white;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-align: left;
}

.faq-toggle span { font-size: 1.5rem; color: var(--primary); font-family: 'JetBrains Mono'; transition: 0.3s; }

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: 0.4s ease;
    opacity: 0;
}

.faq-item.active .faq-content { max-height: 200px; padding-bottom: 1.5rem; opacity: 1; }
.faq-item.active .faq-toggle span { transform: rotate(45deg); }
.faq-content p { color: var(--text-muted); font-size: 0.95rem; }

/* Footer */
.footer { background: #050506; border-top: 1px solid var(--border); padding: 5rem 0 3rem; }
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer h4 { color: white; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 1.5rem; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 0.75rem; }
.footer ul a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: 0.3s; }
.footer ul a:hover { color: white; }

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'JetBrains Mono';
    font-size: 0.65rem;
    color: #334155;
}

.system-status { display: flex; gap: 2rem; }

/* Chat Section */
#chat-section {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    background: black;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.chat-header {
    height: 60px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.status-info { display: flex; align-items: center; gap: 0.5rem; font-size: 0.7rem; color: var(--primary); font-weight: 700; }

.exit-btn {
    background: #ef4444;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
}

.iframe-wrapper { flex: 1; position: relative; }
#chat-iframe { width: 100%; height: 100%; border: none; }

.floating-exit-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2100;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

@media (min-width: 1024px) {
    .iframe-wrapper { padding: 20px; background: var(--bg); }
    #chat-iframe { border-radius: 12px; }
    .floating-exit-btn { display: none; }
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 3rem; }
    .nav-links { display: none; }
    .exit-btn { display: none; }
    .floating-exit-btn { display: flex; }
}