:root {
    --bg-base: #000000;
    --bg-surface: #0a0a0a;
    --bg-elevated: #141414;
    --border: #222222;
    --border-hover: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --accent: #10b981;
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme overrides */
body.light-theme {
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-elevated: #f1f5f9;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent: #059669;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s, color 0.3s;
}

/* Navigation */
nav {
    position: fixed;
    top: 0; width: 100%;
    padding: 1.2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(var(--bg-base-rgb, 0,0,0), 0.7);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}
body.light-theme nav { background: rgba(255,255,255, 0.8); }

.brand {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    text-decoration: none;
    color: var(--text-primary);
}
.brand span { color: var(--accent); }

.nav-links { display: flex; gap: 2rem; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; transition: var(--transition); font-weight: 500;}
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); }

.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary { background: var(--text-primary); color: var(--bg-base); }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}
.theme-toggle:hover { background: var(--bg-elevated); }

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
}

/* Page Headers */
.page-header {
    text-align: center;
    padding: 120px 20px 60px;
}
.page-header h1 { font-size: 3rem; margin-bottom: 1rem; letter-spacing: -0.03em; }
.page-header p { color: var(--text-secondary); font-size: 1.15rem; max-width: 600px; margin: 0 auto; }

/* Hero Section (Index) */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: 100vh;
    padding-top: 80px;
}
.hero-content h1 { font-size: clamp(3rem, 5vw, 4.5rem); line-height: 1.05; letter-spacing: -0.04em; margin-bottom: 1.5rem; font-weight: 600; }
.hero-content p { font-size: 1.15rem; color: var(--text-secondary); margin-bottom: 2.5rem; max-width: 90%; }
.hero-buttons { display: flex; gap: 1rem; }

/* Terminal (Index) */
.terminal { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); }
.terminal-header { display: flex; gap: 8px; padding: 1rem; border-bottom: 1px solid var(--border); background: var(--bg-elevated); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #333; }
.dot:nth-child(1) { background: #ff5f56; }
.dot:nth-child(2) { background: #ffbd2e; }
.dot:nth-child(3) { background: #27c93f; }
.terminal-body { padding: 1.5rem; font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; color: var(--text-secondary); min-height: 320px; }
.prompt { color: var(--accent); margin-right: 8px; }
.cmd-text { color: var(--text-primary); }
.cursor { display: inline-block; width: 8px; height: 1em; background: var(--text-primary); animation: blink 1s infinite; vertical-align: middle; }
@keyframes blink { 0%, 100% {opacity: 1} 50% {opacity: 0} }
.out-line { margin-top: 0.5rem; opacity: 0; transition: opacity 0.2s; }

/* Grid Components */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; margin-bottom: 4rem; }
.card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; transition: var(--transition); }
.card:hover { border-color: var(--border-hover); background: var(--bg-elevated); transform: translateY(-4px); }
.card h3 { font-size: 1.25rem; font-weight: 500; margin-bottom: 1rem; color: var(--text-primary); }
.card p { color: var(--text-secondary); font-size: 0.95rem; }

/* Dashboard Bars */
.bar-container { background: var(--bg-elevated); border-radius: 99px; height: 12px; width: 100%; overflow: hidden; margin: 1rem 0; }
.bar-fill { background: var(--accent); height: 100%; width: 0%; transition: width 1.5s cubic-bezier(0.1, 0.7, 0.1, 1); }
.dashboard-stat { display: flex; justify-content: space-between; font-family: 'JetBrains Mono', monospace; font-size: 0.9rem;}

/* Sliders */
.slider-group { margin-bottom: 2.5rem; }
.slider-header { display: flex; justify-content: space-between; margin-bottom: 1rem; font-weight: 500;}
.slider-val { font-family: 'JetBrains Mono', monospace; color: var(--accent); }
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 20px; width: 20px; border-radius: 50%; background: var(--accent); cursor: pointer; margin-top: -8px; box-shadow: 0 0 10px rgba(16, 185, 129, 0.5); }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 4px; cursor: pointer; background: var(--border-hover); border-radius: 4px; }

.price-box { text-align: center; padding: 3rem; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 2rem; }
.price-box h2 { font-size: 4rem; color: var(--text-primary); letter-spacing: -0.05em; margin-bottom: 0.5rem; }
.price-box p { color: var(--text-secondary); margin-bottom: 2rem;}

/* Footer */
footer { border-top: 1px solid var(--border); padding: 4rem 5%; text-align: center; color: var(--text-secondary); font-size: 0.9rem; }

/* ===== Markets (SectorPulse) ===== */
.nav-new { font-family: 'JetBrains Mono', monospace; font-size: 0.6rem; font-weight: 600; color: var(--bg-base); background: var(--accent); padding: 1px 5px; border-radius: 4px; margin-left: 6px; vertical-align: 2px; }
.new-pill { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; color: var(--text-secondary); border: 1px solid var(--border); background: var(--bg-surface); padding: 0.35rem 0.9rem 0.35rem 0.35rem; border-radius: 99px; margin-bottom: 1.5rem; text-decoration: none; transition: var(--transition); }
a.new-pill:hover { border-color: var(--accent); color: var(--text-primary); }
.new-pill b { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; color: var(--bg-base); background: var(--accent); padding: 2px 8px; border-radius: 99px; }
.mk-up { color: var(--accent); }
.mk-down { color: #ef4444; }
.mk-muted { color: var(--text-secondary); font-size: 0.9rem; }
.mk-muted a, .mk-status a { color: var(--accent); }
.mk-section { margin: 0 auto 6rem; max-width: 1200px; }
.mk-section h2 { font-size: 1.8rem; letter-spacing: -0.02em; font-weight: 600; }
.mk-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.mk-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; padding: 3px; background: var(--bg-surface); }
.mk-seg button { background: transparent; border: 0; color: var(--text-secondary); padding: 0.4rem 1rem; border-radius: 6px; cursor: pointer; font: inherit; font-size: 0.85rem; }
.mk-seg button.active { background: var(--bg-elevated); color: var(--text-primary); }
.mk-status { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 1.5rem; }
.mk-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; box-shadow: 0 0 8px var(--accent); }
.mk-bench { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.card.mk-b { padding: 1.25rem 1.5rem; }
.mk-b-l { font-size: 0.75rem; letter-spacing: 0.06em; color: var(--text-secondary); font-weight: 600; }
.mk-b-p { font-family: 'JetBrains Mono', monospace; font-size: 1.4rem; font-weight: 600; margin: 0.2rem 0; }
.mk-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.5rem; }
.card.mk-card { padding: 1.75rem; }
.card.mk-card:hover { transform: none; }
.mk-heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.5rem; }
.mk-h { display: flex; flex-direction: column; justify-content: space-between; gap: 0.4rem; min-height: 72px; padding: 0.7rem 0.8rem; border-radius: 8px; color: var(--text-primary); text-decoration: none; font-size: 0.8rem; transition: var(--transition); }
.mk-h:hover { transform: translateY(-2px); }
.mk-h b { font-family: 'JetBrains Mono', monospace; font-size: 1rem; }
.mk-movers { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.mk-sub { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 0.5rem; }
.mk-list { list-style: none; }
.mk-list li { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.45rem 0; border-bottom: 1px solid var(--border); font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; }
.mk-list li span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-list li span:last-child { flex-shrink: 0; }
.mk-list li:last-child { border-bottom: 0; }
/* Home page promo */
.mk-promo { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 3rem; margin: 0 auto 6rem; position: relative; overflow: hidden; }
.mk-promo::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px circle at 0% 0%, rgba(16,185,129,0.12), transparent 60%); pointer-events: none; }
.mk-promo h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 1rem; font-weight: 600; }
.mk-promo p { color: var(--text-secondary); margin-bottom: 2rem; }
.mk-ticker { display: grid; gap: 0.6rem; position: relative; }
.mk-tick { display: grid; grid-template-columns: 1fr auto 80px; gap: 1rem; align-items: center; padding: 0.9rem 1.1rem; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text-primary); transition: var(--transition); }
.mk-tick:hover { border-color: var(--border-hover); }
.mk-tick-l { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; color: var(--text-secondary); }
.mk-tick-p { font-family: 'JetBrains Mono', monospace; font-weight: 600; }
.mk-tick-c { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; text-align: right; }
.mk-skel { height: 52px; border-radius: 8px; background: var(--bg-elevated); border: 1px solid var(--border); animation: mkpulse 1.2s infinite alternate; }
@keyframes mkpulse { from { opacity: 0.5; } to { opacity: 1; } }

@media (max-width: 900px) {
    .mk-cols, .mk-promo { grid-template-columns: 1fr; }
    .mk-promo { padding: 2rem; text-align: center; }
    .mk-promo .hero-buttons { justify-content: center; }
    .hero { grid-template-columns: 1fr; padding-top: 120px; text-align: center; }
    .hero-content p { margin: 0 auto 2.5rem; }
    .hero-buttons { justify-content: center; }
    .nav-links { display: none; }
}
