:root {
    --bg: #0a0000;
    --bg-2: #120404;
    --bg-3: #1a0808;
    --fg: #f5f0f0;
    --fg-dim: #a89a9a;
    --accent: #ff2b2b;
    --accent-2: #ff6b6b;
    --green: #4ade80;
    --amber: #fbbf24;
    --border: rgba(255, 43, 43, 0.18);
    --border-2: rgba(255, 255, 255, 0.06);
    --radius: 12px;
    --radius-lg: 18px;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
    --sans: 'Space Grotesk', system-ui, sans-serif;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--sans);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

#mesh, #cursorGlow, #particles,.scanlines {
position: fixed;
inset: 0;
pointer-events: none;
z-index: 0;
}
#mesh { z-index: -3; }
#cursorGlow { z-index: -2; }
#particles { z-index: -1; }
.scanlines {
    z-index: 1;
    background: repeating-linear-gradient(0deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px, transparent 1px, transparent 3px);
    mix-blend-mode: overlay;
    animation: scan 8s linear infinite;
}
@keyframes scan {
    from { background-position: 0 0; }
    to { background-position: 0 100px; }
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ==================== KEYFRAMES ==================== */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}
@keyframes scroll {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-50%, 0, 0); }
}
@keyframes fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 43, 43, 0.45); }
    70% { box-shadow: 0 0 0 12px rgba(255, 43, 43, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 43, 43, 0); }
}
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}
@keyframes shimmer {
    from { background-position: -200% 0; }
    to { background-position: 200% 0; }
}
@keyframes border-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== NAV ==================== */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(10, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-2);
    animation: fade-in 0.5s var(--ease-out) both;
}

.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: 0.02em; }
.brand-mark {
    color: var(--accent);
    font-size: 20px;
    display: inline-block;
    animation: float 4s var(--ease) infinite;
}
.brand-text { font-size: 18px; }
.brand-ver { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; }
.accent { color: var(--accent); }

.nav-links { display: flex; gap: 24px; font-size: 14px; color: var(--fg-dim); }
.nav-links a { position: relative; transition: color 0.2s var(--ease); }
.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease-out);
}
.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after { transform: scaleX(1); }

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.15s var(--ease), background 0.15s var(--ease),
    border-color 0.15s var(--ease), box-shadow 0.2s var(--ease);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover {
    background: var(--accent-2);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 43, 43, 0.35);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--fg); }
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-2px); }
.btn-lg { padding: 14px 26px; font-size: 16px; }

.btn-emoji { font-size: 16px; line-height: 1; }
.btn-label { line-height: 1; }

/* ==================== HERO ==================== */
.hero { padding: 100px 32px 60px; max-width: 1100px; margin: 0 auto; text-align: center; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    color: var(--fg-dim);
    font-family: var(--mono);
    margin-bottom: 24px;
    animation: fade-up 0.6s var(--ease-out) both;
}
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: pulse 2s var(--ease) infinite;
}

.hero-title {
    font-size: clamp(36px, 6vw, 68px);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    animation: fade-up 0.7s var(--ease-out) 0.05s both;
}
.gradient-text {
    background: linear-gradient(90deg, var(--accent), var(--accent-2), #ffb0b0, var(--accent));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradient-shift 6s var(--ease) infinite;
}
.hero-sub {
    font-size: 18px;
    color: var(--fg-dim);
    max-width: 640px;
    margin: 0 auto 32px;
    animation: fade-up 0.7s var(--ease-out) 0.12s both;
}
.hero-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 48px;
    animation: fade-up 0.7s var(--ease-out) 0.18s both;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 800px;
    margin: 0 auto 40px;
    animation: fade-up 0.7s var(--ease-out) 0.24s both;
}
.stat {
    padding: 16px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    background: var(--bg-2);
    transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.stat:hover { border-color: var(--border); transform: translateY(-2px); }
.stat-value { font-size: 24px; font-weight: 700; font-family: var(--mono); }
.stat-label { font-size: 12px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.05em; }

.ticker-wrap {
    overflow: hidden;
    border-top: 1px solid var(--border-2);
    border-bottom: 1px solid var(--border-2);
    padding: 12px 0;
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker {
    display: flex;
    gap: 32px;
    white-space: nowrap;
    width: max-content;
    animation: scroll 30s linear infinite;
    font-family: var(--mono);
    font-size: 13px;
}
/* FIX 1: descendant selector (space) */
.ticker-wrap:hover.ticker { animation-play-state: paused; }
.ticker-item.up { color: var(--green); }
.ticker-item.down { color: var(--accent); }

/* ==================== SECTIONS ==================== */
.section { padding: 80px 32px; max-width: 1100px; margin: 0 auto; }
.section-head { text-align: center; margin-bottom: 48px; }
.eyebrow { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: 0.1em; }
.section-head h2 { font-size: clamp(28px, 4vw, 44px); margin: 8px 0 12px; letter-spacing: -0.02em; }
.section-sub { color: var(--fg-dim); max-width: 560px; margin: 0 auto; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card,.chain-card,.wallet-card {
    padding: 24px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    background: var(--bg-2);
    transition: border-color 0.25s var(--ease), transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
    position: relative;
    overflow: hidden;
}
.card::before,.chain-card::before,.wallet-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 43, 43, 0.5), transparent 70%);
    background-size: 200% 100%;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s var(--ease);
    pointer-events: none;
}
.card:hover::before,.chain-card:hover::before,.wallet-card:hover::before {
    opacity: 1;
    animation: border-flow 2.5s linear infinite;
}
.card:hover,.chain-card:hover,.wallet-card:hover {
    border-color: var(--border);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(255, 43, 43, 0.12);
}
.card-num { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-bottom: 12px; }
.card h3,.chain-card h3,.wallet-card h3 { font-size: 18px; margin-bottom: 8px; }
.card p,.chain-card p,.wallet-card p { color: var(--fg-dim); font-size: 14px; margin-bottom: 16px; }

.chain-icon,.wallet-icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: inline-block;
    transition: transform 0.3s var(--ease-out);
}
/* FIX 2 + 3: descendant selectors */
.chain-card:hover.chain-icon { transform: scale(1.15) rotate(-4deg); }
.wallet-card:hover.wallet-icon { transform: scale(1.15) rotate(-4deg); }

.wallet-card.btn { width: 100%; margin-bottom: 8px; }
.install-note { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); text-align: center; }

/* ==================== LEADERBOARD ==================== */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-2); border-radius: var(--radius-lg); }
.leaderboard { width: 100%; border-collapse: collapse; font-size: 14px; }
.leaderboard th,.leaderboard td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-2); }
.leaderboard th { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.leaderboard tbody tr { transition: background 0.2s var(--ease); }
.leaderboard tbody tr:hover { background: var(--bg-3); }
.leaderboard tr:last-child td { border-bottom: none; }
.pnl-up { color: var(--green); font-family: var(--mono); }
.status-live { color: var(--green); font-family: var(--mono); font-size: 12px; }
.status-live::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: blink 1.6s var(--ease) infinite;
}
.status-idle { color: var(--fg-dim); font-family: var(--mono); font-size: 12px; }

/* ==================== FAQ ==================== */
.faq-list { display: flex; flex-direction: column; gap: 12px; max-width: 720px; margin: 0 auto; }
details {
    padding: 16px 20px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    background: var(--bg-2);
    transition: border-color 0.2s var(--ease);
}
details:hover { border-color: var(--border); }
details[open] { border-color: var(--border); }
details summary { cursor: pointer; font-weight: 600; list-style: none; position: relative; padding-right: 24px; }
details summary::-webkit-details-marker { display: none; }
details summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 0;
    color: var(--accent);
    font-family: var(--mono);
    transition: transform 0.25s var(--ease-out);
}
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--fg-dim); margin-top: 12px; font-size: 14px; animation: rise 0.3s var(--ease-out) both; }

/* ==================== FOOTER ==================== */
.footer { padding: 40px 32px; border-top: 1px solid var(--border-2); text-align: center; }
.footer-inner { display: flex; align-items: center; justify-content: center; gap: 12px; }
.footer-ver { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); }

/* ==================== MODAL ==================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease), visibility 0.25s var(--ease);
}
.modal.open { opacity: 1; visibility: visible; }
.modal[inert] { pointer-events: none; }

.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(6px); }

.modal-panel {
    position: relative;
    width: min(440px, calc(100vw - 32px));
    padding: 28px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    transform: translateY(12px) scale(0.97);
    transition: transform 0.3s var(--ease-out);
}
/* FIX 4: descendant selector */
.modal.open.modal-panel { transform: translateY(0) scale(1); }

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 20px;
    color: var(--fg-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.modal-close:hover { background: var(--bg-3); color: var(--fg); transform: rotate(90deg); }

.modal-panel h3 { font-size: 20px; margin-bottom: 6px; }
.modal-sub { color: var(--fg-dim); font-size: 14px; margin-bottom: 20px; }

.modal-providers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
}
/* FIX 5: descendant selector */
.modal-providers.btn {
    width: 100%;
    padding: 14px 12px;
    font-size: 14px;
    justify-content: center;
}

/* ==================== REVEAL ==================== */
/* FIX 7: only hide when JS is active, so content shows if app.js fails */
.js.reveal { opacity: 0; transform: translateY(24px); }
.js.reveal.in { animation: fade-up 0.7s var(--ease-out) both; }

/* FIX 6: stagger the children of.grid (the grid itself has no.reveal) */
.grid >.reveal.in:nth-child(1) { animation-delay: 0s; }
.grid >.reveal.in:nth-child(2) { animation-delay: 0.08s; }
.grid >.reveal.in:nth-child(3) { animation-delay: 0.16s; }
.grid >.reveal.in:nth-child(4) { animation-delay: 0.24s; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 720px) {
    .nav { padding: 12px 16px; }
    .nav-links { display: none; }
    .hero { padding: 60px 16px 40px; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; }
    .section { padding: 60px 16px; }
    .modal-providers { grid-template-columns: 1fr 1fr; }
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
    .scanlines,.ticker,.gradient-text,.brand-mark,.pulse-dot,.status-live::before {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
    }
    .js.reveal.in { animation-duration: 0.01ms; }
}
