/*
 * V9 Bundle 5 — Public-site Quantisage branded chrome.
 *
 * Consolidated design tokens for: index, dashboard, login, about,
 * terms, privacy, disclaimer. Loaded after each page's inline <style>
 * so these tokens cascade-override the legacy gold/cream values.
 *
 * Foundation palette (preserved from existing public-site editorial design):
 *   ink     #0a0a0f  - dark background
 *   paper   #f5f3ee  - light text on dark
 *   cream   #ede9de  - alternate light surface
 *   muted   #6b6860  - secondary text
 *
 * Quantisage canonical accents (per memory/quantisage-branding/SKILL.md):
 *   deep-blue   #1d0c86  - brand primary (Q symbol, headers)
 *   purple      #a100ff  - brand emphasis (CTAs, accents) -- replaces gold
 *   cyan        #00d4ff  - data viz, secondary accent
 *   emerald     #50c878  - success states
 *   light       #f8f7ff  - light backgrounds (Quantisage Light)
 *   light-gray  #e8e6f5  - subtle dividers
 *
 * 80/15/5 application rule (Quantisage spec):
 *   80%  foundation (ink/paper/cream/muted)
 *   15%  primary accent (purple)
 *    5%  secondary accent (cyan + emerald)
 */

:root {
    --ink: #0a0a0f;
    --paper: #f5f3ee;
    --cream: #ede9de;
    --muted: #6b6860;

    --quant-deep-blue: #1d0c86;
    --quant-purple: #a100ff;
    --quant-cyan: #00d4ff;
    --quant-emerald: #50c878;
    --quant-light: #f8f7ff;
    --quant-light-gray: #e8e6f5;

    /* Semantic aliases (these are what components reference) */
    --accent: var(--quant-purple);            /* primary brand accent (was: gold #c9a961) */
    --accent-secondary: var(--quant-cyan);     /* secondary accent (was: purple #8b5cf6) */
    --status-good: var(--quant-emerald);
    --status-warn: #ff9900;
    --status-bad: #9b2c2c;
    --status-info: var(--quant-cyan);
}

/* ===== Cascade override: replace any inline 'gold' with the new accent ===== */
/* Each public page's inline <style> uses --accent: #c9a961. This file loads AFTER, so :root above wins. */

/* ===== Quantisage co-branding footer block =====
 * Used in the right column of each public-site footer.
 * Markup pattern:
 *   <div class="quant-attrib">
 *     <span class="quant-attrib-label">A PRODUCT OF</span>
 *     <a href="https://quantisage.com" class="quant-attrib-link">
 *       <img src="/assets/img/quantisage_logo_small.svg" alt="Quantisage">
 *       <span class="quant-attrib-name">Quantisage</span>
 *     </a>
 *   </div>
 */
.quant-attrib {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    margin-top: 12px;
}
.quant-attrib-label {
    font-family: 'JetBrains Mono', 'Inter', monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted, #6b6860);
}
.quant-attrib-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--paper, #f5f3ee);
    transition: opacity 0.15s ease;
}
.quant-attrib-link:hover {
    opacity: 0.85;
    color: var(--accent);
}
.quant-attrib-link img {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: var(--quant-light);
    padding: 2px;
}
.quant-attrib-name {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ===== Samurai brand mark in nav =====
 * Replaces the small gold dot (.logo .sym) in index/about with an actual logo.
 * Markup pattern:
 *   <a href="/" class="logo">
 *     <img src="/assets/img/phantom_ai_logo.svg" class="sym brand-mark" alt="">
 *     PhantomAI
 *   </a>
 *
 * High-specificity selectors are required because each page's inline <style>
 * sets `nav.top .logo .sym { width:8px; height:8px; background:var(--accent) }`
 * — that's 3 specificity points and would otherwise win and squeeze the <img>
 * into an 8x8 colored square. The selectors below match or beat that.
 */
nav.top .logo img.sym,
nav.top .logo img.brand-mark,
nav.top .logo .sym.brand-mark,
header.hd .logo img,
.header .logo img,
nav.top a.logo img,
.logo img.brand-mark {
    width: 28px !important;
    height: 28px !important;
    background: linear-gradient(135deg, var(--quant-deep-blue), var(--quant-purple)) !important;
    border-radius: 7px !important;
    padding: 1px !important;
    box-shadow: 0 0 0 1px rgba(161, 0, 255, 0.3) !important;
    display: inline-block !important;
}

/* Footer brand-block logo (larger size for footer column) */
footer .col .logo img,
footer .logo img {
    width: 32px !important;
    height: 32px !important;
    background: linear-gradient(135deg, var(--quant-deep-blue), var(--quant-purple)) !important;
    border-radius: 8px !important;
    padding: 1px !important;
    vertical-align: middle !important;
}

/* ===== Button accent override =====
 * Existing pages have .btn-primary using gold. We promote purple here. */
.btn-primary,
.btn.cta,
button.cta-primary,
a.cta-primary {
    background: var(--accent) !important;
    color: var(--quant-light) !important;
    border-color: var(--accent) !important;
}
.btn-primary:hover:not(:disabled),
.btn.cta:hover,
button.cta-primary:hover,
a.cta-primary:hover {
    background: #8b00d9 !important;     /* slightly deeper purple */
    border-color: #8b00d9 !important;
}

/* ===== Subtle Quantisage palette refinements =====
 * Hover states, link colors, etc. — applied lightly so existing per-page CSS still wins for layout. */
a.subtle-accent,
.text-accent {
    color: var(--accent);
}
.border-accent {
    border-color: var(--accent);
}

/* ===== Mode-aware indicator (in case any public copy mentions "trading") =====
 * Class can be added to wrap any "trading" mention with paper-mode emphasis if needed. */
.paper-mode-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(0, 212, 255, 0.12);
    color: var(--quant-cyan);
    border: 1px solid rgba(0, 212, 255, 0.3);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ===== Mobile safety: nav fallback at very narrow viewports ===== */
@media (max-width: 480px) {
    nav.top {
        padding: 16px 18px !important;
    }
    nav.top .logo {
        font-size: 18px !important;
    }
    .quant-attrib-link img {
        width: 18px;
        height: 18px;
    }
}
