:root {
    --bg: #F2E8E4;
    --bg-card: #FFFFFF;
    --accent: #E65127;
    --accent-hover: #D04520;
    --accent-light: rgba(230, 81, 39, 0.08);
    --text: #1A1A1A;
    --text-secondary: #666666;
    --text-light: #999999;
    --border: #E8E0DC;
    --green: #28A745;
    --red: #DC3545;
    --yellow: #F5A623;
    --font: 'Albert Sans', -apple-system, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

.container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* ===== TICKER ===== */
.ticker {
    background: var(--text);
    color: #fff;
    padding: 8px 0;
    font-size: 0.8rem;
    overflow: hidden;
}

.ticker-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.ticker-item { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.ticker-alert { color: var(--yellow); }

.dot { width: 6px; height: 6px; border-radius: 50%; }
.dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.red { background: var(--red); }

/* ===== NAVBAR ===== */
.navbar {
    background: var(--accent);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(230, 81, 39, 0.3);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
}

.brand-icon { font-size: 1.5rem; }
.brand-name { font-size: 1.3rem; font-weight: 800; letter-spacing: 0.5px; }
.brand-name span { font-weight: 400; opacity: 0.9; }

.nav-links { display: flex; list-style: none; gap: 0; }

.nav-links a {
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 20px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
    background: rgba(0,0,0,0.1);
    border-bottom-color: #fff;
}

.nav-actions { display: flex; align-items: center; }

.search-trigger {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

.search-trigger:hover { background: rgba(0,0,0,0.15); }

/* ===== SEARCH OVERLAY ===== */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
}

.search-overlay.active { display: flex; }

.search-modal {
    background: #fff;
    border-radius: var(--radius);
    padding: 8px 16px;
    width: 560px;
    max-width: 90vw;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.search-modal input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 1.1rem;
    font-family: var(--font);
    padding: 12px 0;
    color: var(--text);
}

.search-modal kbd {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.75rem;
    color: var(--text-light);
    font-family: var(--mono);
}

/* ===== HEADER BANNERS ===== */
.header-banners {
    background: var(--accent); /* Now seamlessly connected to the hero */
    padding: 16px 0;
    /* Removed border to eliminate the seam */
}

.banners-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.banner-slot {
    display: block;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.15); /* Slightly stronger border to define edges on orange */
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); /* Softer drop shadow for orange bg */
}

.banner-slot:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    border-color: rgba(255,255,255,0.4);
}

.banner-slot img {
    width: 100%;
    height: 90px; /* Increased from 75px for better visibility */
    object-fit: cover;
    display: block;
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(180deg, var(--accent) 0%, #c94420 100%); /* Straight vertical gradient to perfectly blend top edge with banners */
    padding: 24px 0 40px; /* Reduced top padding since banners add space */
    color: #fff;
}

.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    position: relative; /* added for absolute positioning of mascot */
}

.hero-text { flex: 1; max-width: 600px; }

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.hero h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.05rem;
    opacity: 0.9;
    line-height: 1.7;
    margin-bottom: 24px;
}

.hero-stats { display: flex; gap: 32px; }
.stat { display: flex; flex-direction: column; }
.stat strong { font-size: 1.6rem; font-weight: 800; }
.stat span { font-size: 0.8rem; opacity: 0.75; font-weight: 500; }

/* Raccoon in Hero — exact TorCat alignment */
.hero-mascot {
    position: absolute;
    right: 0;
    bottom: -80px; /* Lifted up slightly to rest elbows exactly on the line */
    z-index: 10;
}

.hero-mascot img {
    width: 365px; /* User requested exact size */
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4)); /* Softer, richer shadow */
}

/* ===== MAIN CONTENT ===== */
.main-content { padding-top: 32px; padding-bottom: 48px; }

.content-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 28px;
    align-items: start;
}

/* ===== SECTIONS ===== */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-head h2 { font-size: 1.3rem; font-weight: 700; }

.count-badge {
    background: var(--accent-light);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.78rem;
    font-weight: 600;
}

section { margin-bottom: 36px; }

/* ===== TABLE ===== */
.table-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border);
}

.market-table { width: 100%; border-collapse: collapse; }

.market-table thead {
    background: #FAFAFA;
    border-bottom: 2px solid var(--border);
}

.market-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.market-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 0.9rem;
    vertical-align: middle;
}

.market-table tr:last-child td { border-bottom: none; }
.market-table tr { transition: background 0.15s; }
.market-table tbody tr:hover { background: var(--accent-light); }

.highlight-row {
    background: rgba(230, 81, 39, 0.04) !important;
    border-left: 3px solid var(--accent);
}

.market-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}

.market-cell img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.market-cell div { display: flex; flex-direction: column; }
.market-cell strong { font-weight: 700; font-size: 0.92rem; }
.market-cell span { font-size: 0.75rem; color: var(--text-light); }

.status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status.online { background: rgba(40,167,69,0.1); color: var(--green); }
.status.online::before { background: var(--green); box-shadow: 0 0 4px var(--green); }
.status.offline { background: rgba(220,53,69,0.1); color: var(--red); }
.status.offline::before { background: var(--red); }

.crypto-icons {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.uptime-cell {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--green);
}

.uptime-cell.warn { color: var(--yellow); }
.uptime-cell.perfect { color: var(--accent); font-weight: 700; }

.enter-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.enter-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 81, 39, 0.3);
}

.enter-btn.disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== SIDEBAR ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 80px;
}

/* Raccoon in sidebar - hidden, hero only */
.sidebar-raccoon {
    display: none;
}

.sidebar-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.sidebar-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.pgp-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.5;
}

.pgp-btn {
    width: 100%;
    background: var(--text);
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.pgp-btn:hover { opacity: 0.85; }

.ad-card {
    padding: 0;
    overflow: hidden;
    position: relative;
}

.ad-card img { width: 100%; height: auto; display: block; }

.ad-label {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 1;
}

.facts-card ul { list-style: none; }

.facts-card li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.facts-card li:last-child { border-bottom: none; }
.facts-card li span { color: var(--text-secondary); }
.facts-card li strong { font-weight: 700; }
.facts-card li strong.red { color: var(--red); }

/* ===== FOOTER ===== */
.footer {
    background: var(--accent);
    color: #fff;
    padding: 40px 0;
    text-align: center;
}

.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer p { opacity: 0.85; font-size: 0.88rem; max-width: 420px; }
.footer-links { display: flex; gap: 24px; margin-top: 4px; }

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover { color: #fff; }
.copyright { font-size: 0.75rem; opacity: 0.6; margin-top: 8px; }

/* ===== BOTTOM ARTICLES / GUIDES ===== */
.bottom-articles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 60px;
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s;
    box-shadow: var(--shadow);
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(230, 81, 39, 0.3);
}

.article-img {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    background: #fff; /* Default white background for images */
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.article-img.nexus-bg { background: #000; }
.article-img.pgp-bg { background: #F8F9FA; border-bottom: 1px solid #EBEBEB; }

.article-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.article-card:hover .article-img img {
    transform: scale(1.05);
}

.article-content {
    padding: 32px 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.4;
}

.article-content h3 a {
    color: var(--text);
    text-decoration: none;
    background-image: linear-gradient(var(--text), var(--text));
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.3s ease, color 0.3s ease;
}

.article-card:hover .article-content h3 a {
    color: var(--accent);
    background-image: linear-gradient(var(--accent), var(--accent));
    background-size: 100% 2px;
}

.article-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .bottom-articles {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--text);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .content-grid { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .hero-inner { flex-direction: column; text-align: center; }
    .hero-mascot { 
        position: relative; 
        right: auto; 
        bottom: auto; 
        margin: 20px auto -52px auto; 
    }
    .hero-mascot img { width: 300px; transform: none; }
    .hero-stats { justify-content: center; }
    .hero h1 { font-size: 1.8rem; }
    .banners-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .nav-links { display: none; }
    .hero { padding: 28px 0; }
    .hero h1 { font-size: 1.4rem; }
    .hero-stats { flex-wrap: wrap; gap: 16px; }
    .hero-mascot { margin: 20px auto -30px auto; }
    .hero-mascot img { width: 220px; transform: none; }
    .banners-row { grid-template-columns: 1fr 1fr; gap: 8px; }
    .banner-slot img { height: 60px; /* Increased slightly for mobile proportionality */ }
    .market-table th:nth-child(3),
    .market-table td:nth-child(3),
    .market-table th:nth-child(4),
    .market-table td:nth-child(4) { display: none; }
    .market-cell { min-width: 140px; }
    .sidebar-raccoon { display: none; }
}
