@tailwind base;
@tailwind components;
@tailwind utilities;

/* EchoTrade Design System - Institutional Rebuild */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --accent: #00E08A;
    --accent-glow: rgba(0, 224, 138, 0.2);
    --canvas: #070708;
    --surface: rgba(20, 20, 22, 0.6);
    --border: rgba(255, 255, 255, 0.06);
    --border-bright: rgba(255, 255, 255, 0.12);
    --text-primary: #FFFFFF;
    --text-secondary: #94949E;
    --glass-blur: blur(24px);
    --glass-bg: rgba(10, 10, 11, 0.7);
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--canvas);
}

body {
    background-color: var(--canvas);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

/* Ambient Flow Blobs */
body::before, body::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

body::before {
    background: var(--accent);
    top: -10%;
    right: -10%;
    animation: drift 20s infinite alternate ease-in-out;
}

body::after {
    background: #00A3FF;
    bottom: -10%;
    left: -10%;
    animation: drift 25s infinite alternate-reverse ease-in-out;
}

@keyframes drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(100px, 50px) scale(1.2); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--canvas);
}
::-webkit-scrollbar-thumb {
    background: var(--border-bright);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.mono {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: -0.02em;
}

/* Institutional Typography */
h1, h2, h3 {
    letter-spacing: -0.04em;
    font-weight: 700;
}

/* Layered Glassmorphism */
.glass-nav {
    background: transparent;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-nav.scrolled {
    background: rgba(10, 10, 11, 0.8);
    backdrop-filter: var(--glass-blur) saturate(180%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Signal Green CTA */
.btn-accent {
    background: var(--accent);
    color: #000;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 0 0 var(--accent-glow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 12px 24px;
    border-radius: 4px;
}

.btn-accent:hover {
    box-shadow: 0 10px 40px -5px var(--accent-glow);
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* Advanced Dashboard Glass Cards */
.dashboard-card {
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.06) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.dashboard-card:hover {
    border-color: var(--border-bright);
    background: rgba(24, 24, 27, 0.7);
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
}

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

/* Stats Matrix Enhancements */
.stat-large {
    font-size: 84px;
    line-height: 1;
    font-weight: 800;
    background: linear-gradient(to bottom, #fff 40%, #94949E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
    .stat-large { font-size: 48px; }
}

/* Flow Section */
.step-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    padding: 40px;
    border-radius: 12px;
    transition: all 0.4s;
}

.step-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--accent);
}

/* Expert Polish */
section {
    will-change: transform, opacity;
}

.mono-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--text-secondary);
}

/* Institutional Reel Engine */
.counter-reel {
    display: inline-flex;
    height: 90px;
    line-height: 90px;
    overflow: hidden;
    position: relative;
    vertical-align: bottom;
    padding: 0 4px;
}

.counter-reel::before,
.counter-reel::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 30%;
    z-index: 2;
    pointer-events: none;
}

.counter-reel::before {
    top: 0;
    background: linear-gradient(to bottom, var(--canvas) 0%, transparent 100%);
}

.counter-reel::after {
    bottom: 0;
    background: linear-gradient(to top, var(--canvas) 0%, transparent 100%);
}

.reel-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0s;
}

.reel-column > div {
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0.6em;
}

.stat-large {
    font-size: 84px;
    line-height: 1;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 2px;
}

@media (max-width: 768px) {
    .stat-large { font-size: 48px; }
}

/* =============================================
   ANIMATIONS & KEYFRAMES
   ============================================= */

/* Marquee ticker */
.animate-marquee { animation: marquee 40s linear infinite; }
@keyframes marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Ambient glow pulse */
.animate-pulse-slow { animation: pulse-slow 10s ease-in-out infinite; }
@keyframes pulse-slow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50%       { opacity: 0.6; transform: scale(1.1); }
}

/* Slow spin */
.animate-spin-slow { animation: et-spin 8s linear infinite; }
@keyframes et-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Allocation bar grow */
@keyframes grow {
    from { width: 0; }
    to   { width: 78%; }
}

/* Glow filter */
.filter-glow { filter: drop-shadow(0 0 5px #00E08A); }

/* Hero sparkline draw-on */
#hero-sparkline {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: draw-line 2.5s ease-out forwards 0.5s;
}
@keyframes draw-line { to { stroke-dashoffset: 0; } }

/* Live trade feed slide-in */
.trade-feed > div {
    opacity: 0;
    transform: translateX(10px);
    animation: slide-in 0.4s ease-out forwards;
}
.trade-feed > div:nth-child(1) { animation-delay: 0.8s; }
.trade-feed > div:nth-child(2) { animation-delay: 1.1s; }
.trade-feed > div:nth-child(3) { animation-delay: 1.4s; }
@keyframes slide-in { to { opacity: 1; transform: translateX(0); } }

/* Floating chips */
@keyframes float-chip {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-8px); }
}

/* =============================================
   NAV COMPONENTS
   ============================================= */

.nav-item { position: relative; }
.nav-item::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s ease;
}
.nav-item:hover::after { width: 100%; }


@media (max-width: 768px) {
    .stat-large, .counter-reel, .reel-column > div { 
        font-size: 48px; 
        height: 54px; 
        line-height: 54px; 
    }
}

/* =============================================
   SCROLL REVEAL SYSTEM
   ============================================= */

.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1);
}
.reveal.reveal--left  { transform: translateX(-32px); }
.reveal.reveal--right { transform: translateX(32px); }
.reveal.reveal--scale { transform: scale(0.96); }
.reveal.is-visible {
    opacity: 1;
    transform: none;
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.45s; }

/* =============================================
   SECTION FLOW & RHYTHM
   ============================================= */

/* Pull-down scroll cue */
.scroll-cue {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: 48px;
    animation: cue-bounce 2s ease-in-out infinite;
}
.scroll-cue::after {
    content: '';
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: cue-grow 2s ease-in-out infinite;
}
@keyframes cue-bounce {
    0%,100% { opacity: 0.4; transform: translateY(0); }
    50%      { opacity: 1;   transform: translateY(6px); }
}
@keyframes cue-grow {
    0%,100% { transform: scaleY(1); opacity: 0.3; }
    50%      { transform: scaleY(1.3); opacity: 1; }
}

/* Interstitial pull-quote band */
.pull-quote-band {
    border-top: 1px solid rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    background: linear-gradient(135deg, rgba(0,224,138,0.03) 0%, transparent 60%);
    padding: 48px 0;
    text-align: center;
}
.pull-quote-band blockquote {
    font-size: clamp(1.2rem, 2.5vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.3;
    color: #fff;
    max-width: 780px;
    margin: 0 auto;
}
.pull-quote-band blockquote em { color: var(--accent); font-style: normal; }

/* Accent divider line */
.section-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--accent), transparent);
    opacity: 0.2;
    margin: 0;
}

/* Sticky progress bar */
#scroll-progress {
    position: fixed;
    top: 80px;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--accent);
    z-index: 100;
    box-shadow: 0 0 8px var(--accent);
    transition: width 0.1s linear;
}

