/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700&display=swap');

:root {
    /* Base Colors - Deep Space/Cyberpunk Theme */
    --color-background: #050510;
    --color-foreground: #ffffff;

    /* Primary - Neon Cyan */
    --color-primary: #00f2ff;
    --color-primary-hover: #00c8d4;

    /* Secondary - Muted Slate */
    --color-secondary: #1e293b;
    --color-secondary-foreground: #ffffff;

    /* Accent */
    --color-accent: rgba(0, 242, 255, 0.1);
    --color-accent-foreground: #00f2ff;

    /* Status Colors */
    --color-success: #00ff9d;
    --color-warning: #ffcc00;

    /* Glassmorphism Tokens */
    --glass-bg: rgba(17, 25, 40, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --container-padding: 2rem;
    --max-width: 1200px;
    --header-height: 80px;
}

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

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

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-foreground);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.text-gradient {
    background: linear-gradient(90deg, var(--color-primary), #00aaff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--color-primary);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.4);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 0 25px rgba(0, 242, 255, 0.6);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--color-foreground);
    backdrop-filter: blur(4px);
}

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}

/* Header */
header {
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
    background: rgba(5, 5, 16, 0.8);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
}

.logo img {
    height: 32px;
}

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

nav a {
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.8;
}

nav a:hover {
    opacity: 1;
    color: var(--color-primary);
    text-shadow: 0 0 8px rgba(0, 242, 255, 0.5);
}

/* Logo Styling (atsX) */
.logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
    text-decoration: none;
}

.logo-main {
    display: flex;
    align-items: flex-start;
    gap: 2px;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2rem;
    color: var(--color-foreground);
    letter-spacing: -0.025em;
}

.logo-x {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.75rem;
    background: linear-gradient(135deg, #f1f5f9 0%, #bae6fd 50%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: -2px;
    text-shadow: 0 1px 2px rgba(148, 163, 184, 0.3),
        0 2px 4px rgba(56, 189, 248, 0.2);
    filter: drop-shadow(0 2px 4px rgba(56, 189, 248, 0.25));
}

.logo-sub {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    background: linear-gradient(90deg, #94a3b8 0%, rgba(255, 255, 255, 0.7) 50%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}



/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--header-height);
    position: relative;
    overflow: hidden;
}

/* Background Gradients */
.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(0, 242, 255, 0.15) 0%, transparent 70%);
    filter: blur(80px);
    z-index: -1;
    animation: float 10s ease-in-out infinite alternate;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -5%;
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, rgba(120, 0, 255, 0.1) 0%, transparent 70%);
    filter: blur(80px);
    z-index: -1;
    animation: float 15s ease-in-out infinite alternate-reverse;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    /* Increased gap */
    height: 200px;
    overflow: hidden;
    margin-bottom: 2rem;
    position: relative;
    width: 100%;
    max-width: 800px;
    /* Background removed */
    background: transparent;
    border: none;

    /* Fade mask */
    mask-image: linear-gradient(to right, transparent, black 5%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 90%, transparent);
}

.candle-wrapper {
    width: 20px;
    height: 100%;
    position: relative;
    flex-shrink: 0;
    /* Animate margin-left to pull chart left, linear for constant speed */
    transition: margin-left 2s linear, opacity 1.5s ease;
    opacity: 1;
    margin-right: 0;
    /* Keep layout stable */
    margin-left: 0;
}

/* Class to handle smooth removal */
.candle-wrapper.exiting {
    /* Pull the element left by width (20px) + gap (8px) = 28px */
    margin-left: -28px;
    opacity: 0;
    /* Do NOT change width/transform, keep it solid while moving */
}

.candle-body {
    position: absolute;
    width: 12px;
    /* Wider body */
    left: 50%;
    transform: translateX(-50%);
    /* Centered */
    border-radius: 2px;
    min-height: 2px;
    transition: height 1s ease;
    /* Smooth height updates if reused */
    z-index: 2;
}

.signal-badge {
    position: absolute;
    bottom: 10px;
    /* Position at bottom of chart area */
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 4px;
    border-radius: 4px;
    color: #000;
    text-transform: uppercase;
    font-family: var(--font-heading);
    opacity: 0;
    animation: flashSignal 0.5s ease-out forwards;
    white-space: nowrap;
    z-index: 10;
}

.signal-badge.buy {
    background: #00ff9d;
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.6);
}

.signal-badge.sell {
    background: #ff0055;
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.6);
}

@keyframes flashSignal {
    0% {
        transform: translateX(-50%) scale(0);
        opacity: 0;
    }

    50% {
        transform: translateX(-50%) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
}

.ai-spark {
    position: absolute;
    /* Bottom is set dynamically in JS */
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    opacity: 0;
    animation: sparkIn 2s ease-out forwards;
    /* Reset filter as SVG has internal colors, but glow is nice */
    filter: drop-shadow(0 0 8px rgba(0, 242, 255, 0.4));
}

.ai-spark svg {
    width: 24px;
    height: 24px;
}

@keyframes sparkIn {
    0% {
        transform: translateX(-50%) translateY(0) scale(0);
        opacity: 0;
    }

    100% {
        transform: translateX(-50%) translateY(-15px) scale(1);
        opacity: 1;
    }
}

.candle-wick {
    position: absolute;
    width: 1px;
    left: 50%;
    transform: translateX(-50%);
    background-color: currentColor;
    opacity: 0.8;
    z-index: 1;
}

/* Colors */
.up-candle .candle-body,
.up-candle .candle-wick {
    color: #00fa9a;
    background-color: #00fa9a;
    box-shadow: 0 0 8px rgba(0, 250, 154, 0.3);
}

.down-candle .candle-body,
.down-candle .candle-wick {
    color: #ff4d4d;
    background-color: #ff4d4d;
    box-shadow: 0 0 8px rgba(255, 77, 77, 0.3);
}

@keyframes scaleUp {
    from {
        transform: scaleY(0);
    }

    to {
        transform: scaleY(1);
    }
}

.terminal-badge {
    background: rgba(0, 242, 255, 0.05);
    border: 1px solid rgba(0, 242, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--color-primary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.1);
    max-width: 90vw;
    /* Prevent overflow on small screens */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cursor {
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

.badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid rgba(0, 242, 255, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    color: var(--color-primary);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.25rem;
    color: #94a3b8;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Stats Section */
.stats-bar {
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    background: rgba(13, 17, 23, 0.5);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    margin-top: -5rem;
    /* Pull up to overlap hero bottom */
    position: relative;
    z-index: 20;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat-item h3 {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.stat-item p {
    color: #94a3b8;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Features Section */
.features {
    padding: 6rem 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header p {
    color: #94a3b8;
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    background: linear-gradient(145deg, rgba(17, 25, 40, 0.4) 0%, rgba(13, 17, 23, 0.6) 100%);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--color-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 242, 255, 0.2);
    background: linear-gradient(145deg, rgba(17, 25, 40, 0.7) 0%, rgba(13, 17, 23, 0.9) 100%);
}

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

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: rgba(0, 242, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    margin-bottom: 1.25rem;
    border: 1px solid rgba(0, 242, 255, 0.1);
}

.icon-box svg {
    width: 24px;
    height: 24px;
}

.feature-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.feature-card p {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Demo Section */
.demo-section {
    padding: 6rem 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 242, 255, 0.03) 50%, transparent 100%);
}

.demo-browser {
    max-width: 1000px;
    margin: 0 auto;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: #0d1117;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Simulated UI for Demo */
.loading-ui {
    font-family: 'Courier New', monospace;
    color: var(--color-primary);
}

.blinking-cursor::after {
    content: '_';
    animation: blink 1s step-end infinite;
}

/* Footer */
footer {
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--glass-border);
    background: #020205;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: #94a3b8;
    margin-top: 1rem;
    max-width: 300px;
}

.footer-col h4 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col ul li a {
    color: #94a3b8;
    font-size: 0.9rem;
}

.footer-col ul li a:hover {
    color: var(--color-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #64748b;
    font-size: 0.9rem;
}

/* Animations */
@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(20px, 20px);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

/* Responsive */
@media (max-width: 900px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero h1 {
        font-size: 3rem;
    }

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

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }

    .footer-brand p {
        margin: 1rem auto 0;
    }

    /* Mobile Nav */
    .menu-toggle {
        display: block;
        z-index: 1001;
        width: 30px;
        height: 30px;
        position: relative;
        cursor: pointer;
    }

    /* Hamburger icon */
    .menu-toggle::before,
    .menu-toggle::after,
    .menu-toggle div {
        content: '';
        position: absolute;
        width: 100%;
        height: 2px;
        background-color: var(--color-foreground);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        left: 0;
        border-radius: 2px;
    }

    .menu-toggle::before {
        top: 6px;
    }

    .menu-toggle div {
        top: 14px;
        background-color: var(--color-primary);
        /* Accent line */
    }

    .menu-toggle::after {
        top: 22px;
    }

    /* Active Hamburger */
    .menu-toggle.active::before {
        transform: rotate(45deg);
        top: 14px;
    }

    .menu-toggle.active div {
        opacity: 0;
        transform: translateX(-10px);
    }

    .menu-toggle.active::after {
        transform: rotate(-45deg);
        top: 14px;
    }

    nav ul {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        /* Hidden by default */
        width: 100%;
        height: 100vh;
        background: rgba(5, 5, 16, 0.98);

        @supports (backdrop-filter: blur(20px)) {
            background: rgba(5, 5, 16, 0.85);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
        }

        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        padding-top: var(--header-height);
        padding-bottom: 2rem;
    }

    nav.active ul {
        right: 0;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    nav ul li {
        width: 100%;
        text-align: center;
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.4s ease, transform 0.4s ease;
    }

    nav.active ul li {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered animation for list items */
    nav.active ul li:nth-child(1) {
        transition-delay: 0.1s;
    }

    nav.active ul li:nth-child(2) {
        transition-delay: 0.15s;
    }

    nav.active ul li:nth-child(3) {
        transition-delay: 0.2s;
    }

    nav.active ul li:nth-child(4) {
        transition-delay: 0.25s;
    }

    nav a {
        font-size: 1.75rem;
        font-weight: 700;
        display: inline-block;
        padding: 0.5rem 1rem;
        color: var(--color-foreground);
    }

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

    /* Make Login button huge on mobile */
    nav ul li:last-child {
        margin-top: 2rem;
        width: 80%;
    }

    nav ul li:last-child a.btn {
        width: 100%;
        display: flex;
        font-size: 1.25rem;
        border: 1px solid var(--color-primary);
        background: rgba(0, 242, 255, 0.1);
        color: var(--color-primary);
        padding: 1rem;
    }
}

@media (max-width: 600px) {
    .hero h1 {
        font-size: 2.25rem;
        padding: 0 0.5rem;
    }

    .hero p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .cta-group {
        flex-direction: column;
        width: 100%;
        padding: 0 2rem;
    }

    .cta-group .btn {
        width: 100%;
    }

    .hero-chart {
        height: 160px;
        /* Smaller chart for mobile */
        margin-bottom: 1.5rem;
    }

    .terminal-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: 1fr;
        /* Stack stats on very small screens */
        gap: 2rem;
    }

    .logo-text {
        font-size: 1.75rem;
    }

    .logo-x {
        font-size: 1.5rem;
    }

    .menu-toggle {
        transform: scale(0.9);
    }
}