/* ================================================================
   WEALTHGRID HUB — INSTITUTIONAL FINANCIAL TERMINAL v10.0
   Premium Dark Mode Design System
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── DESIGN TOKENS ── */
:root {
    --brand-cyan:   #22d3ee;
    --brand-indigo: #818cf8;
    --brand-green:  #4ade80;
    --brand-amber:  #fbbf24;
    --brand-red:    #f87171;

    --bg-base:      #06050a;
    --bg-surface:   #0d0c14;
    --bg-card:      #13111d;
    --bg-card-alt:  #1a1826;
    --bg-glass:     rgba(19,17,29,0.85);
    --bg-glass-2:   rgba(255,255,255,0.03);

    --border-subtle: rgba(255,255,255,0.06);
    --border-light:  rgba(255,255,255,0.11);
    --border-cyan:   rgba(34,211,238,0.25);

    --text-primary:  #f0eeff;
    --text-secondary: #9592b0;
    --text-muted:     #5f5c7a;

    --glow-cyan:  0 0 40px rgba(34,211,238,0.18);
    --glow-indigo:0 0 40px rgba(129,140,248,0.14);

    --nav-h:       72px;
    --tick-h:      36px;
    --radius-sm:   10px;
    --radius-md:   18px;
    --radius-lg:   28px;
    --radius-xl:   40px;

    --ease-snappy: cubic-bezier(0.16,1,0.3,1);
    --transition:  0.35s var(--ease-snappy);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: color var(--transition); }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── LAYOUT ── */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 28px;
}
.container--narrow { max-width: 860px; }
.container--article { max-width: 780px; }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-primary);
}

.headline-xl   { font-size: clamp(2.8rem, 6vw, 5.5rem); }
.headline-lg   { font-size: clamp(2.2rem, 4vw, 3.5rem); }
.headline-md   { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.headline-sm   { font-size: clamp(1.2rem, 2vw, 1.6rem); }
.body-lg       { font-size: 1.2rem; line-height: 1.75; }
.body-md       { font-size: 1rem; line-height: 1.7; }
.body-sm       { font-size: 0.875rem; line-height: 1.65; }
.caption       { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; }
.mono          { font-family: 'JetBrains Mono', monospace; }

.text-primary      { color: var(--text-primary) !important; }
.text-secondary    { color: var(--text-secondary) !important; }
.text-muted        { color: var(--text-muted) !important; }
.text-cyan         { color: var(--brand-cyan) !important; }
.text-green        { color: var(--brand-green) !important; }
.text-indigo       { color: var(--brand-indigo) !important; }
.text-red          { color: var(--brand-red) !important; }

/* ── GRADIENT TEXT ── */
.gradient-text {
    background: linear-gradient(135deg, var(--brand-cyan) 0%, var(--brand-indigo) 60%, var(--brand-green) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.gradient-text--cyan-indigo {
    background: linear-gradient(135deg, var(--brand-cyan), var(--brand-indigo));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── BADGE / PILL ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.badge--cyan  { background: rgba(34,211,238,0.08); border: 1px solid rgba(34,211,238,0.25); color: var(--brand-cyan); }
.badge--green { background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.25); color: var(--brand-green); }
.badge--indigo{ background: rgba(129,140,248,0.08); border: 1px solid rgba(129,140,248,0.25); color: var(--brand-indigo); }

.badge .pulse {
    width: 6px; height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: pulse 2s ease infinite;
}
@keyframes pulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.5);opacity:.5} }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-cyan), var(--brand-indigo));
    color: #fff;
    box-shadow: 0 4px 20px rgba(34,211,238,0.25);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(34,211,238,0.35);
}

.btn-outline {
    border: 1px solid var(--border-cyan);
    color: var(--brand-cyan);
    background: rgba(34,211,238,0.04);
}
.btn-outline:hover {
    background: rgba(34,211,238,0.1);
    border-color: var(--brand-cyan);
    transform: translateY(-2px);
}

.btn-ghost {
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-light); }

.btn-sm { padding: 8px 18px; font-size: 0.82rem; }
.btn-lg { padding: 16px 40px; font-size: 1.05rem; }

/* ── CARDS ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}
.card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(0,0,0,0.5);
}
.card--glow:hover {
    border-color: var(--border-cyan);
    box-shadow: 0 12px 48px rgba(0,0,0,0.5), var(--glow-cyan);
}

.card-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

/* ── SECTION SPACING ── */
.section { padding: 100px 0; }
.section--sm { padding: 60px 0; }
.section--lg { padding: 140px 0; }

.section-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--brand-cyan);
    margin-bottom: 16px;
}

.section-header { margin-bottom: 64px; }
.section-header.center { text-align: center; }
.section-header.center .section-desc { margin: 0 auto; }
.section-title { font-size: clamp(1.8rem, 3.5vw, 2.8rem); margin-bottom: 16px; }
.section-desc { font-size: 1.05rem; color: var(--text-secondary); max-width: 560px; line-height: 1.75; }

/* ── DIVIDER ── */
.divider { border: none; border-top: 1px solid var(--border-subtle); }
.divider--glow { border-top-color: rgba(34,211,238,0.15); }

/* ── NAVBAR ── */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: var(--nav-h);
    background: rgba(6,5,10,0.82);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1001;
    transition: all 0.3s ease;
}
.navbar.scrolled {
    background: rgba(6,5,10,0.97);
    border-bottom-color: var(--border-cyan);
}
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 24px;
}

/* Logo */
.logo { flex-shrink: 0; }
.logo a { display: flex; align-items: center; gap: 10px; }
.logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--brand-cyan), var(--brand-indigo));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 15px rgba(34,211,238,0.3);
    flex-shrink: 0;
}
.logo-icon svg { width: 18px; height: 18px; color: #fff; }
.logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.logo-text span { color: var(--brand-cyan); }

/* Nav Links */
.nav-links {
    display: flex;
    gap: 2px;
    list-style: none;
    background: var(--bg-glass-2);
    border: 1px solid var(--border-subtle);
    padding: 4px;
    border-radius: 999px;
}
.nav-links li a {
    display: block;
    padding: 7px 18px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.nav-links li a:hover,
.nav-links li a.active {
    color: var(--text-primary);
    background: rgba(255,255,255,0.07);
}

/* Nav Actions */
.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 9px;
    color: var(--text-primary);
    transition: all 0.2s;
}
.mobile-toggle:hover { border-color: var(--border-cyan); color: var(--brand-cyan); }

/* ── TICKER ── */
.ticker-wrap {
    position: fixed;
    top: var(--nav-h);
    left: 0; width: 100%;
    height: var(--tick-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    align-items: center;
}
.ticker {
    display: flex;
    white-space: nowrap;
    animation: ticker-scroll 60s linear infinite;
}
.ticker:hover { animation-play-state: paused; }
@keyframes ticker-scroll { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 40px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
}
.ticker-item .name { color: var(--text-primary); }
.ticker-item .up   { color: var(--brand-green); }
.ticker-item .down { color: var(--brand-red); }
.ticker-item::before {
    content: '|';
    color: var(--border-light);
    font-size: 0.6rem;
}
.ticker-item:first-child::before { display: none; }

/* ── HEADER SPACER ── */
#header-placeholder { height: calc(var(--nav-h) + var(--tick-h)); }

/* ── SCROLL ANIMATIONS ── */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.65s var(--ease-snappy), transform 0.65s var(--ease-snappy);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.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.4s; }

/* ── FORMS ── */
.form-group { margin-bottom: 24px; }
.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 13px 18px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--brand-cyan);
    box-shadow: 0 0 0 3px rgba(34,211,238,0.08);
}
.form-input::placeholder { color: var(--text-muted); }

/* ── FOOTER ── */
.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    padding: 80px 0 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 56px;
    margin-bottom: 56px;
}
.footer-brand-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.75;
    max-width: 280px;
    margin-top: 18px;
}
.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}
.footer-social-btn {
    width: 36px; height: 36px;
    background: var(--bg-glass-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.footer-social-btn:hover {
    color: var(--brand-cyan);
    border-color: var(--border-cyan);
    background: rgba(34,211,238,0.06);
}
.footer-social-btn svg { width: 16px; height: 16px; }
.footer-col-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    margin-bottom: 20px;
}
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul li a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.footer-col ul li a:hover { color: var(--text-primary); padding-left: 4px; }
.footer-bottom {
    padding-top: 32px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.footer-bottom p { font-size: 0.8rem; color: var(--text-muted); }
.footer-trust { display: flex; gap: 20px; }
.footer-trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.footer-trust-item svg { width: 14px; height: 14px; color: var(--brand-green); }

/* ── ARTICLE / BLOG ── */
.article-container { padding-top: calc(var(--nav-h) + var(--tick-h) + 48px); padding-bottom: 80px; }
.article-category {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand-cyan);
    margin-bottom: 20px;
}
.article-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 28px;
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.article-hero-img {
    width: 100%;
    height: 460px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    margin-bottom: 64px;
    border: 1px solid var(--border-subtle);
}
.article-body h2 {
    font-size: 1.8rem;
    margin: 52px 0 20px;
}
.article-body h3 { font-size: 1.35rem; margin: 36px 0 14px; }
.article-body p { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.85; }
.article-body ul, .article-body ol { padding-left: 20px; margin-bottom: 24px; }
.article-body li { font-size: 1.05rem; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.7; }
.article-body li::marker { color: var(--brand-cyan); }
.article-body strong { color: var(--text-primary); }

.article-callout {
    background: rgba(34,211,238,0.05);
    border: 1px solid var(--border-cyan);
    border-radius: var(--radius-md);
    padding: 28px 32px;
    margin: 40px 0;
}
.article-callout strong { color: var(--brand-cyan); display: block; margin-bottom: 8px; }

/* ── TOOL PAGES ── */
.tool-container {
    padding-top: calc(var(--nav-h) + var(--tick-h));
    padding-bottom: 80px;
    min-height: 100vh;
}
.tool-header { padding: 60px 0 48px; }
.tool-title { font-size: clamp(2rem, 4vw, 3.5rem); margin-bottom: 14px; }
.tool-subtitle { font-size: 1.15rem; color: var(--text-secondary); }

.calc-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 48px;
}

.result-display {
    background: linear-gradient(135deg, rgba(34,211,238,0.06), rgba(129,140,248,0.06));
    border: 1px solid var(--border-cyan);
    border-radius: var(--radius-md);
    padding: 40px;
    text-align: center;
    margin-bottom: 32px;
}
.result-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--brand-cyan);
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .nav-links {
        position: fixed;
        top: var(--nav-h);
        right: -360px;
        width: 300px;
        flex-direction: column;
        background: var(--bg-card);
        border: 1px solid var(--border-light);
        border-radius: var(--radius-md);
        padding: 16px;
        display: flex !important;
        transition: right var(--transition);
        z-index: 1002;
    }
    .nav-links.active { right: 20px; }
    .nav-links li a {
        border-radius: var(--radius-sm);
        padding: 12px 16px;
    }
    .mobile-toggle { display: flex; }
    .nav-actions .btn-ghost { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 768px) {
    .section { padding: 70px 0; }
    .container { padding: 0 20px; }
    .footer-grid { grid-template-columns: 1fr; gap: 36px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    .calc-panel { padding: 28px 24px; }
    .article-hero-img { height: 260px; }
}
@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .btn-lg { padding: 14px 28px; font-size: 0.95rem; }
    .footer-trust { flex-wrap: wrap; }
}

/* ── UNIVERSAL CALCULATOR & TOOL STYLES ── */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}
.tool-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}
.tool-select {
    width: 100%;
    background: rgba(0,0,0,0.4) url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%239592b0%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E") no-repeat right 16px center;
    background-size: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 13px 40px 13px 18px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition);
}
.tool-select:focus {
    border-color: var(--brand-cyan);
    box-shadow: 0 0 0 3px rgba(34,211,238,0.08);
}
.tool-select option { background: var(--bg-surface); color: #fff; }

.result-card-premium {
    background: linear-gradient(135deg, rgba(34,211,238,0.08), rgba(129,140,248,0.08));
    border: 1px solid var(--border-cyan);
    border-radius: var(--radius-md);
    padding: 32px;
    text-align: center;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    word-break: break-word;
}
.result-card-premium h3 { color: var(--text-secondary); font-size: 1rem; text-transform: uppercase; letter-spacing: 0.1em; }
.result-card-premium h2 { font-size: clamp(2rem, 5vw, 3.5rem); color: #fff; font-family: 'JetBrains Mono', monospace; font-weight: 800; }
.result-card-premium p { color: var(--text-muted); font-size: 0.9rem; }

/* Tool responsiveness overrides */
@media (max-width: 600px) {
    .tool-grid { grid-template-columns: 1fr; gap: 16px; }
    .card-glass { padding: clamp(20px, 5vw, 24px) !important; }
    input.form-input, select.tool-select { font-size: 16px; /* prevent iOS zoom */ padding: 12px; }
    .result-panel { padding: 20px !important; }
    h1 { font-size: 2rem !important; }
}
