/* ==========================================================================
   NicotineWire™ — Scandinavian / Apple-Minimalist Institutional Terminal
   Obsidian Glass, Swiss Tabular Typography, Precision Hairlines
   ========================================================================== */

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

:root {
    /* Obsidian & Nordic Glass Surfaces */
    --nw-bg: #09090b;
    --nw-surface: rgba(18, 18, 22, 0.75);
    --nw-surface-hover: rgba(28, 28, 34, 0.85);
    --nw-surface-solid: #111115;
    --nw-surface-subtle: #16161c;
    
    /* Typography Palette */
    --nw-text-primary: #FFFFFF;
    --nw-text-secondary: #A1A1AA;
    --nw-text-muted: #71717A;
    --nw-text-faint: #52525B;

    /* Signature Accent Palette (Restrained & Purposeful) */
    --nw-brand-yellow: #FFEA00;
    --nw-emerald: #10B981;
    --nw-emerald-dim: rgba(16, 185, 129, 0.12);
    --nw-emerald-border: rgba(16, 185, 129, 0.28);
    
    --nw-rose: #F43F5E;
    --nw-rose-dim: rgba(244, 63, 94, 0.12);
    --nw-rose-border: rgba(244, 63, 94, 0.28);

    --nw-blue: #38BDF8;
    --nw-blue-dim: rgba(56, 189, 248, 0.10);
    --nw-blue-border: rgba(56, 189, 248, 0.25);

    --nw-amber: #F59E0B;
    --nw-amber-dim: rgba(245, 158, 11, 0.10);
    --nw-amber-border: rgba(245, 158, 11, 0.25);

    /* Apple Precision Hairline Borders */
    --nw-border: rgba(255, 255, 255, 0.08);
    --nw-border-light: rgba(255, 255, 255, 0.14);
    --nw-border-active: rgba(255, 255, 255, 0.22);

    /* ==========================================================================
       Legacy Compatibility Bridge (--moz-* -> Scandinavian / Apple Palette)
       ========================================================================== */
    --moz-bg: var(--nw-bg);
    --moz-surface: var(--nw-surface);
    --moz-surface-hover: var(--nw-surface-hover);
    --moz-surface-solid: var(--nw-surface-solid);
    --moz-surface-subtle: var(--nw-surface-subtle);
    --moz-subtle: var(--nw-surface-subtle);
    --moz-border: var(--nw-border);
    --moz-border-light: var(--nw-border-light);
    --moz-border-active: var(--nw-border-active);
    --moz-text: var(--nw-text-primary);
    --moz-primary: var(--nw-text-primary);
    --moz-secondary: var(--nw-text-secondary);
    --moz-muted: var(--nw-text-muted);
    --moz-faint: var(--nw-text-faint);

    /* Single Purpose Accent: subtle emerald reserved for live status & verified telemetry */
    --moz-emerald: var(--nw-emerald);
    
    /* Restrained Scandinavian monochrome replacement for legacy Bloomberg neon */
    --moz-amber: #E4E4E7;
    --moz-blue: #FFFFFF;
    --moz-rose: var(--nw-text-secondary);

    /* Apple System & Swiss Typography Stacks */
    --font-slab: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", -apple-system, sans-serif;

    /* Font Stacks */
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", -apple-system, sans-serif;
    --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

    /* Radii */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-pill: 9999px;
}

/* ==========================================================================
   CSS Reset & Native Performance (Zero Gimmicks)
   ========================================================================== */

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

html {
    background-color: var(--nw-bg);
    color: var(--nw-text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

body {
    background-color: var(--nw-bg);
    color: var(--nw-text-secondary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Scrollbar Minimalist */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Viewport Container
   ========================================================================== */

.app-viewport {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 32px 24px 80px 24px;
    flex: 1;
}

@media (max-width: 768px) {
    .app-viewport {
        padding: 16px 14px 80px 14px;
    }
}

/* ==========================================================================
   Header & Glass Navigation (Apple Scandinavian Style)
   ========================================================================== */

header.nw-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: rgba(9, 9, 11, 0.82);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--nw-border);
    padding: 0 32px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 768px) {
    header.nw-header {
        padding: 0 16px;
        height: 52px;
    }
}

.nw-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--nw-text-primary);
    transition: opacity 0.15s ease;
}

.nw-brand:hover {
    opacity: 0.88;
}

.nw-brand-icon {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    object-fit: contain;
    box-shadow: 0 2px 8px rgba(255, 234, 0, 0.2);
}

.nw-brand-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #FFFFFF;
}

.nw-brand-badge {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--nw-text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--nw-border);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
}

/* Nav Links - Subtle, Modern Centering */
.nw-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

@media (max-width: 768px) {
    .nw-nav {
        display: none;
    }
}

.nw-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--nw-text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.01em;
    padding: 6px 2px;
    transition: color 0.15s ease;
    position: relative;
}

.nw-nav-link:hover {
    color: #FFFFFF;
}

.nw-nav-link.active {
    color: #FFFFFF;
    font-weight: 600;
}

.nw-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    right: 0;
    height: 2px;
    background: #FFFFFF;
    border-radius: 1px;
}

.nw-nav-link svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.nw-nav-link:hover svg,
.nw-nav-link.active svg {
    opacity: 1;
}

.nw-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nw-header-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--nw-text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--nw-border);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.nw-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--nw-emerald);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: pulseGlow 2.5s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.9); }
}

/* ==========================================================================
   Hero Banner (Nordic Restraint)
   ========================================================================== */

.nw-hero-banner {
    position: relative;
    padding: 40px 0 28px 0;
    text-align: left;
    border-bottom: 1px solid var(--nw-border);
    margin-bottom: 24px;
}

.nw-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--nw-text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--nw-border);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    margin-bottom: 16px;
}

.nw-hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    color: #FFFFFF;
    line-height: 1.15;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .nw-hero-title {
        font-size: 1.6rem;
    }
}

.nw-hero-subtitle {
    font-size: 1.05rem;
    color: var(--nw-text-secondary);
    max-width: 640px;
    line-height: 1.55;
    font-weight: 400;
}

/* ==========================================================================
   Commodity Spot Ticker (Apple Stocks / Swiss Precision Standard)
   ========================================================================== */

.nw-ticker-strip {
    display: flex;
    align-items: center;
    background: var(--nw-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--nw-border);
    border-radius: var(--radius-md);
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 32px;
    padding: 8px 12px;
}

.nw-ticker-strip::-webkit-scrollbar {
    display: none;
}

.nw-ticker-cell {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 18px;
    border-right: 1px solid var(--nw-border);
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 12px;
    font-feature-settings: "tnum" 1;
}

.nw-ticker-cell:last-child {
    border-right: none;
}

.nw-ticker-code {
    font-weight: 700;
    color: var(--nw-text-primary);
    font-size: 11px;
    letter-spacing: 0.04em;
}

.nw-ticker-price {
    font-weight: 600;
    color: #FFFFFF;
    font-size: 12px;
}

.nw-ticker-up {
    color: var(--nw-emerald);
    font-weight: 600;
    font-size: 11px;
}

.nw-ticker-down {
    color: var(--nw-rose);
    font-weight: 600;
    font-size: 11px;
}

.nw-ticker-flat {
    color: var(--nw-text-muted);
    font-size: 11px;
}

.nw-ticker-terms {
    color: var(--nw-text-faint);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* ==========================================================================
   Section Headers
   ========================================================================== */

.nw-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--nw-border);
}

.nw-section-title h2 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--nw-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nw-section-title a {
    color: var(--nw-text-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.15s ease;
}

.nw-section-title a:hover {
    color: #FFFFFF;
}

/* ==========================================================================
   Live Wire Feed Cards (Bento Stream)
   ========================================================================== */

.nw-feed-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.nw-feed-item {
    background: var(--nw-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--nw-border);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-shadow: none;
}

@media (max-width: 768px) {
    .nw-feed-item {
        padding: 18px 16px;
    }
}

.nw-feed-item:hover {
    background: var(--nw-surface-hover);
    border-color: var(--nw-border-light);
    transform: translateY(-1px);
}

.nw-feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.nw-feed-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--nw-text-muted);
}

.nw-badge {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--nw-text-secondary);
    border: 1px solid var(--nw-border);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* Scandinavian Single Purpose Accent: subtle emerald only for live status & verified badges */
.nw-badge-live,
.nw-badge-verified,
.nw-badge-earnings,
.nw-badge-emerald {
    background: rgba(16, 185, 129, 0.08);
    color: var(--nw-emerald);
    border: 1px solid rgba(16, 185, 129, 0.24);
}

/* Restrained obsidian monochrome hairline badges */
.nw-badge-fda,
.nw-badge-cfr,
.nw-badge-ma,
.nw-badge-neutral {
    background: rgba(255, 255, 255, 0.04);
    color: var(--nw-text-secondary);
    border: 1px solid var(--nw-border);
}

.nw-feed-title {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #FFFFFF;
    line-height: 1.4;
    margin-bottom: 8px;
}

.nw-feed-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.nw-feed-title a:hover {
    color: #FFFFFF;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.nw-feed-excerpt {
    font-size: 13.5px;
    color: var(--nw-text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    max-width: 900px;
}

.nw-feed-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--nw-border);
    padding-top: 12px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--nw-text-muted);
}

.nw-feed-read-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: gap 0.15s ease, opacity 0.15s ease;
}

.nw-feed-read-link:hover {
    gap: 7px;
    opacity: 0.9;
}

/* ==========================================================================
   Institutional Reports Grid (Bento Matrix)
   ========================================================================== */

.nw-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.nw-card {
    background: var(--nw-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--nw-border);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none;
}

@media (max-width: 768px) {
    .nw-card {
        padding: 18px 16px;
    }
}

.nw-card:hover {
    background: var(--nw-surface-hover);
    border-color: var(--nw-border-light);
    transform: translateY(-2px);
}

/* Compatibility bridge for inline frosted glass */
[style*="--moz-surface"],
[style*="var(--moz-surface)"],
.nw-frosted {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Swiss Tabular Data & Pricing Standard */
.nw-ticker-price,
.nw-ticker-cell,
.nw-card-price,
.tabular-nums,
table,
.nw-table,
.nw-table th,
.nw-table td {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

.nw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    text-align: left;
    margin: 8px 0;
}

.nw-table th {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--nw-text-muted);
    border-bottom: 1px solid var(--nw-border);
    padding: 10px 14px;
}

.nw-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--nw-border);
    color: var(--nw-text-secondary);
}

.nw-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.nw-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.nw-card-price {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: #FFFFFF;
    font-feature-settings: "tnum" 1;
}

.nw-card-title {
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: #FFFFFF;
    line-height: 1.35;
    margin-bottom: 8px;
}

.nw-card-text {
    font-size: 12.5px;
    color: var(--nw-text-secondary);
    line-height: 1.5;
    margin-bottom: 18px;
}

.nw-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--nw-border);
    padding-top: 12px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--nw-text-muted);
}

/* ==========================================================================
   Buttons (Tactile, Crisp, Apple-Grade)
   ========================================================================== */

.btn-primary {
    background: #FFFFFF;
    color: #09090B;
    border: none;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.btn-primary:hover {
    background: #F4F4F5;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-moz-outline {
    background: rgba(255, 255, 255, 0.04);
    color: #E4E4E7;
    border: 1px solid var(--nw-border);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-moz-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--nw-border-light);
    color: #FFFFFF;
}

.btn-moz-outline:active {
    transform: scale(0.98);
}

.btn-moz-blue {
    background: #FFFFFF;
    color: #09090B !important;
    border: none;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-moz-blue:hover {
    background: #F4F4F5;
}

.btn-moz-blue:active {
    transform: scale(0.98);
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer.nw-footer {
    border-top: 1px solid var(--nw-border);
    padding: 24px 0;
    margin-top: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--nw-text-muted);
}

@media (max-width: 768px) {
    footer.nw-footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* ==========================================================================
   Mobile Bottom Navigation Bar (Sleek Glass Dock)
   ========================================================================== */

.cr-mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(9, 9, 11, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--nw-border);
    padding: 6px 0 10px 0;
    z-index: 9999;
}

@media (max-width: 768px) {
    .cr-mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    body {
        padding-bottom: 70px;
    }
    .nw-hide-mobile {
        display: none !important;
    }
}

.cr-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--nw-text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    padding: 4px 6px;
    border-radius: var(--radius-xs);
    flex: 1;
    transition: color 0.15s ease;
}

.cr-nav-item.active {
    color: #FFFFFF;
}

.cr-nav-icon-wrap svg {
    width: 18px;
    height: 18px;
    margin-bottom: 2px;
}
