/* Main CSS for Breakaway Civilization Visualizations */

:root {
    --primary-bg: #f6fbff;
    --secondary-bg: #e5eff7;
    --surface-bg: #ffffff;
    --surface-strong: #dbe8f2;
    --panel-glass: rgba(240, 248, 255, 0.88);
    --panel-glass-strong: rgba(230, 243, 252, 0.95);
    --panel-border: #b8cad9;
    --accent-color: #1d8fbf;
    --accent-strong: #0f6f9a;
    --accent-soft: #9ddbf0;
    --accent-contrast: #f7fbff;
    --warning-color: #d45e56;
    --text-primary: #1b2b38;
    --text-secondary: #4f6678;
    --text-muted: #6d8293;
    --grid-color: #c7d7e4;
    --glow-color: rgba(29, 143, 191, 0.35);
    --pulse-color: #79c6ff;
    --northeast-color: #3aa3cc;
    --vortex-color: #8b7cff;
    --hudson-color: #78a6dd;
    --appalachian-color: #3f9b7f;
    --shadow-color: rgba(17, 49, 70, 0.12);
    color-scheme: light;
    
    /* Typography Variables */
    --font-display: 'Cinzel', serif;
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Libre Baskerville', Georgia, serif;
    --font-mono: 'IBM Plex Mono', 'Consolas', monospace;
    --font-terminal: 'Courier New', monospace;
    
    /* Font Sizes - Modular Scale 1.25 */
    --fs-xs: 0.8rem;
    --fs-sm: 0.9rem;
    --fs-base: 1rem;
    --fs-md: 1.25rem;
    --fs-lg: 1.563rem;
    --fs-xl: 1.953rem;
    --fs-2xl: 2.441rem;
    --fs-3xl: 3.052rem;
    --fs-display: 3rem;
    
    /* Line Heights */
    --lh-tight: 1.2;
    --lh-normal: 1.5;
    --lh-relaxed: 1.6;
    --lh-loose: 1.8;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--primary-bg);
    color: var(--text-primary);
    position: relative;
    font-size: var(--fs-base);
    line-height: var(--lh-relaxed);
    font-weight: 400;
    background-image:
        radial-gradient(1200px 600px at 10% -10%, rgba(160, 226, 255, 0.6), transparent 65%),
        radial-gradient(1000px 700px at 90% 0%, rgba(180, 247, 240, 0.5), transparent 60%),
        linear-gradient(180deg, #f6fbff 0%, #edf5fb 45%, #e2edf6 100%);
    background-attachment: fixed;
    /* Fix mobile scrolling issues */
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        repeating-linear-gradient(115deg, rgba(15, 111, 154, 0.04) 0 2px, transparent 2px 16px),
        repeating-linear-gradient(15deg, rgba(29, 143, 191, 0.03) 0 1px, transparent 1px 20px);
    opacity: 0.5;
    pointer-events: none;
    z-index: -1;
}

/* Typography Utility Classes */
.text-display { 
    font-family: var(--font-display); 
    font-weight: 700;
    letter-spacing: -0.02em;
}

.text-heading { 
    font-family: var(--font-heading); 
    font-weight: 600;
    letter-spacing: -0.01em;
}

.text-body { 
    font-family: var(--font-body); 
}

.text-mono { 
    font-family: var(--font-mono); 
    font-size: 0.95em;
}

.text-terminal { 
    font-family: var(--font-terminal); 
}

/* Global Heading Styles */
h2 {
    font-family: var(--font-display);
    font-size: var(--fs-2xl);
    font-weight: 700;
    line-height: var(--lh-tight);
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

h3 {
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    font-weight: 700;
    line-height: var(--lh-tight);
    letter-spacing: -0.01em;
    color: var(--accent-color);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

h4 {
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    font-weight: 600;
    line-height: var(--lh-tight);
    color: var(--accent-color);
    margin-bottom: 0.75rem;
}

h5 {
    font-family: var(--font-heading);
    font-size: var(--fs-md);
    font-weight: 600;
    line-height: var(--lh-normal);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

h6 {
    font-family: var(--font-heading);
    font-size: var(--fs-base);
    font-weight: 600;
    line-height: var(--lh-normal);
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s;
}

.loader {
    text-align: center;
}

.pulse {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: var(--accent-color);
    animation: pulse 2s infinite;
    margin: 0 auto 20px;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Header */
header {
    background-color: var(--panel-glass);
    padding: 10px 20px;
    text-align: center;
    border-bottom: 1px solid var(--panel-border);
    position: relative;
    overflow: hidden;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    max-width: 100%;
    box-sizing: border-box;
}

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(12px)) {
    header {
        background-color: rgba(246, 251, 255, 0.95);
    }
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(29, 143, 191, 0.18), transparent);
    animation: scan 12s infinite;
}

@keyframes scan {
    0% { left: -100%; }
    100% { left: 100%; }
}

h1 {
    font-family: var(--font-display);
    font-size: var(--fs-display);
    font-weight: 900;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    line-height: var(--lh-tight);
    margin-bottom: 10px;
    color: #102331;
    text-shadow: 0 10px 25px rgba(15, 111, 154, 0.18);
}

.subtitle {
    font-family: var(--font-heading);
    font-size: var(--fs-md);
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 20px;
    letter-spacing: 0.02em;
}

.status-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    padding: 0 10px;
}

.status-item {
    padding: 5px 15px;
    background-color: var(--surface-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(17, 49, 70, 0.08);
}

.status-item span {
    color: var(--accent-strong);
    font-weight: 600;
}

/* Global Mute Button — clean SVG icon */
.mute-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s;
    color: rgba(180, 190, 200, 0.5);
    flex-shrink: 0;
}

.mute-btn svg {
    width: 14px;
    height: 14px;
    display: block;
}

.mute-btn:hover {
    background: rgba(48, 213, 200, 0.08);
    color: rgba(48, 213, 200, 0.8);
    border-color: rgba(48, 213, 200, 0.2);
}

.mute-btn:active {
    transform: scale(0.94);
}

/* Muted state (default) */
.mute-btn.muted .mute-icon-on { display: none; }
.mute-btn.muted .mute-icon-off { display: block; }

.mute-btn.muted {
    opacity: 0.6;
}

.mute-btn.muted:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(200, 210, 220, 0.7);
}

/* Unmuted state */
.mute-btn:not(.muted) .mute-icon-on { display: block; }
.mute-btn:not(.muted) .mute-icon-off { display: none; }

.mute-btn:not(.muted) {
    color: rgba(48, 213, 200, 0.7);
    border-color: rgba(48, 213, 200, 0.15);
    background: rgba(48, 213, 200, 0.06);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(29, 143, 191, 0.15);
    }
    50% {
        box-shadow: 0 4px 20px rgba(29, 143, 191, 0.35);
    }
}

.mute-label {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Navigation */
.visualization-menu {
    background-color: var(--panel-glass);
    padding: 8px 10px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    border-bottom: 1px solid var(--panel-border);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 100;
    scrollbar-width: none;
}

.visualization-menu::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    background-color: var(--surface-bg);
    color: var(--text-secondary);
    border: 1px solid var(--panel-border);
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: var(--fs-sm);
    font-weight: 500;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
}

.nav-btn:hover {
    background-color: var(--accent-color);
    color: var(--accent-contrast);
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(29, 143, 191, 0.25);
}

.nav-btn.active {
    background-color: var(--accent-color);
    color: var(--accent-contrast);
    font-weight: bold;
    box-shadow: 0 14px 26px rgba(29, 143, 191, 0.28);
}

/* Main Container */
#visualization-container {
    min-height: calc(100vh - 200px);
    padding: 20px;
    margin-top: 0;
}

.viz-section {
    display: none;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.viz-section.active {
    display: block;
    animation: sectionReveal 0.4s ease-out;
}

@keyframes sectionReveal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.viz-section h2 {
    margin-top: 0;
    padding-top: 10px;
}

/* Compact header when not on overview */
body:not(.on-overview) header {
    padding: 10px 20px;
}

body:not(.on-overview) header h1 {
    font-size: 1.5rem;
}

body:not(.on-overview) .status-bar {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Overview Section */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.overview-card {
    background-color: var(--surface-bg);
    border: 1px solid var(--panel-border);
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 18px 40px rgba(17, 49, 70, 0.08);
}

.overview-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 22px 45px rgba(29, 143, 191, 0.2);
}

.overview-card h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    text-transform: uppercase;
}

.stat-number {
    font-family: var(--font-display);
    font-size: var(--fs-3xl);
    font-weight: 900;
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--accent-color);
    margin: 10px 0;
    letter-spacing: -0.02em;
}

.mini-viz {
    height: 100px;
    margin-top: 20px;
    border-top: 1px solid var(--grid-color);
    padding-top: 10px;
}

.key-insights {
    background-color: var(--panel-glass);
    padding: 30px;
    margin-top: 40px;
    border-left: 4px solid var(--accent-color);
    box-shadow: 0 18px 40px rgba(17, 49, 70, 0.08);
}

.key-insights h3 {
    color: var(--accent-color);
    margin-bottom: 20px;
}

.key-insights ul {
    list-style: none;
}

.key-insights li {
    padding: 10px 0;
    border-bottom: 1px solid var(--grid-color);
    position: relative;
    padding-left: 25px;
}

.key-insights li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

/* Dashboard Layout */
/* ============================================
   DASHBOARD OVERVIEW — Multicolor Obsidian
   ============================================ */

.dashboard-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 48px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

/* ── RESEARCH METRICS — Compact Institutional Strip ── */
.research-metrics {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0;
    margin-bottom: 40px;
    padding: 14px 32px;
    border-top: 1px solid rgba(180, 160, 120, 0.10);
    border-bottom: 1px solid rgba(180, 160, 120, 0.10);
    background: linear-gradient(180deg, rgba(25, 55, 110, 0.06) 0%, transparent 100%);
}

.research-metrics .metric {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 0 24px;
}

.research-metrics .metric-num {
    font-family: 'Space Mono', 'IBM Plex Mono', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: rgba(200, 185, 150, 0.85);
    text-shadow: 0 0 20px rgba(180, 140, 40, 0.15);
    line-height: 1;
}

.research-metrics .metric-label {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(200, 195, 180, 0.5);
    line-height: 1;
}

.research-metrics .metric-sep {
    width: 1px;
    height: 18px;
    background: rgba(180, 160, 120, 0.18);
    flex-shrink: 0;
    align-self: center;
}

@media (max-width: 900px) {
    .research-metrics {
        padding: 10px 12px;
    }
    .research-metrics .metric { padding: 0 10px; gap: 4px; }
    .research-metrics .metric-num { font-size: 1.1rem; }
    .research-metrics .metric-label { font-size: 0.6rem; letter-spacing: 0.1em; }
    .research-metrics .metric-sep { height: 12px; }
}

@media (max-width: 600px) {
    .research-metrics {
        padding: 8px 6px;
    }
    .research-metrics .metric { padding: 0 6px; gap: 3px; }
    .research-metrics .metric-num { font-size: 0.9rem; }
    .research-metrics .metric-label { font-size: 0.5rem; letter-spacing: 0.08em; }
    .research-metrics .metric-sep { height: 10px; }
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 28px;
    background: rgba(10, 10, 14, 0.8);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    color: #e2e0db;
    backdrop-filter: blur(8px);
}

.stat-pill:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.stat-icon {
    font-size: 1.3em;
    opacity: 0.6;
}

.stat-value {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    font-weight: 700;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
}

/* Per-stat colors */
.stat-pill:nth-child(1) { border-bottom-color: #d4af37; }
.stat-pill:nth-child(1) .stat-icon { color: #d4af37; }
.stat-pill:nth-child(1) .stat-value { background: linear-gradient(135deg, #d4af37, #ffd700, #d4af37); background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; animation: statShimmer 4s linear infinite; }
.stat-pill:nth-child(1):hover { box-shadow: 0 12px 32px rgba(0,0,0,0.5), 0 0 20px rgba(212,175,55,0.08); }

.stat-pill:nth-child(2) { border-bottom-color: #f43f5e; }
.stat-pill:nth-child(2) .stat-icon { color: #f43f5e; }
.stat-pill:nth-child(2) .stat-value { background: linear-gradient(135deg, #f43f5e, #ff6b8a, #f43f5e); background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; animation: statShimmer 4s linear infinite; }
.stat-pill:nth-child(2):hover { box-shadow: 0 12px 32px rgba(0,0,0,0.5), 0 0 20px rgba(244,63,94,0.08); }

@keyframes statShimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* Section headings — ruled divider style (high specificity to override design-system.css) */
.magna-theme .viz-section .dashboard-featured h2,
.magna-theme .viz-section .dashboard-grid h2,
.magna-theme .viz-section .dashboard-reading h2,
.magna-theme .viz-section .dashboard-insights h2,
.magna-theme #overview .dashboard-featured h2,
.magna-theme #overview .dashboard-grid h2,
.magna-theme #overview .dashboard-reading h2,
.magna-theme #overview .dashboard-insights h2 {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(200, 195, 180, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    text-shadow: 0 0 20px rgba(212,175,55,0.1);
}

.dashboard-featured h2::before,
.dashboard-featured h2::after,
.dashboard-grid h2::before,
.dashboard-grid h2::after,
.dashboard-reading h2::before,
.dashboard-reading h2::after,
.dashboard-insights h2::before,
.dashboard-insights h2::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,175,55,0.2), transparent);
}

/* Responsive heading text */
.heading-short { display: none; }
@media (max-width: 420px) {
    .heading-full { display: none; }
    .heading-short { display: inline; }
}

/* Featured Visualizations */
.dashboard-featured { margin-bottom: 56px; }

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* Two-hero layout — two big cards side by side */
.featured-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.featured-card-hero .featured-preview {
    height: 200px;
}

.featured-card-hero .featured-info h3 {
    font-size: 1.4rem;
}

@media (max-width: 768px) {
    .featured-grid-2 {
        grid-template-columns: 1fr;
    }
    .featured-card-hero .featured-preview {
        height: 140px;
    }
}

.featured-card {
    background: rgba(10, 16, 32, 0.65);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border: 1px solid rgba(180, 160, 120, 0.10);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255,255,255,0.04);
}

.featured-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    opacity: 0.4;
    transition: opacity 0.5s ease;
    z-index: 2;
}

.featured-card:hover {
    transform: translateY(-5px) scale(1.01);
    border-color: rgba(180, 160, 120, 0.22);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(180, 140, 40, 0.05), inset 0 1px 0 rgba(255,255,255,0.06);
}

.featured-card:hover::before { opacity: 1; }

.featured-preview {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #0a0e1a;
}

.featured-preview-live {
    height: 180px;
    padding: 0;
}

.globe-preview {
    background: radial-gradient(ellipse at 50% 55%, rgba(180,140,40,0.06), transparent 62%), #0a0e1a;
}

.globe-preview .featured-preview-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
    opacity: 0.95;
    filter: drop-shadow(0 10px 26px rgba(0,0,0,0.45));
    transition: opacity 0.6s ease;
}

.globe-preview .globe-preview-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    transform: scale(1.06);
    transform-origin: center center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.globe-preview.is-live .featured-preview-image {
    opacity: 0;
}

.globe-preview.is-live .globe-preview-iframe {
    opacity: 1;
}

#featured-globe-canvas,
#featured-techmap-canvas {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

@media (max-width: 768px) {
    .featured-preview-live {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .featured-preview-live {
        height: 140px;
    }
}

.featured-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.04);
}

.featured-icon {
    opacity: 0.65;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.5));
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.featured-card:hover .featured-icon {
    opacity: 0.95;
    transform: scale(1.08);
}

.featured-info { padding: 20px 24px; }

.featured-info h3 {
    margin-bottom: 8px;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.featured-info p {
    color: rgba(200, 195, 180, 0.65);
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    margin-bottom: 12px;
    line-height: 1.6;
}

.featured-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 3px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(200, 195, 180, 0.5);
}

.featured-launch {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 8px 20px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.14);
    color: rgba(200, 195, 180, 0.7);
    border-radius: 3px;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* ---- FEATURED CARD ACCENT COLORS ---- */

/* Globe — Gold (both data-launch and href variants) */
.featured-card[data-launch="grid-globe"] .featured-preview,
a.featured-card[href*="global-grid"] .featured-preview { background: radial-gradient(ellipse at 55% 65%, rgba(212,175,55,0.07), transparent 65%), #050508; }
.featured-card[data-launch="grid-globe"]::before,
a.featured-card[href*="global-grid"]::before { background: linear-gradient(90deg, transparent, #d4af37, transparent); }
.featured-card[data-launch="grid-globe"] .featured-info h3,
a.featured-card[href*="global-grid"] .featured-info h3 { color: #d4af37; }
.featured-card[data-launch="grid-globe"] .featured-tag,
a.featured-card[href*="global-grid"] .featured-tag { border-color: rgba(212,175,55,0.2); color: rgba(212,175,55,0.6); }
.featured-card[data-launch="grid-globe"] .featured-launch,
a.featured-card[href*="global-grid"] .featured-launch { border-color: rgba(212,175,55,0.3); color: #d4af37; }
.featured-card[data-launch="grid-globe"]:hover,
a.featured-card[href*="global-grid"]:hover { border-color: rgba(212,175,55,0.2); box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(212,175,55,0.08); }
.featured-card[data-launch="grid-globe"]:hover .featured-launch,
a.featured-card[href*="global-grid"]:hover .featured-launch { background: #d4af37; color: #050508; border-color: #d4af37; }

/* Codex — Violet */
.featured-card[data-launch="codex"] .featured-preview { background: radial-gradient(ellipse at 55% 65%, rgba(139,92,246,0.07), transparent 65%), #050508; }
.featured-card[data-launch="codex"]::before { background: linear-gradient(90deg, transparent, #8b5cf6, transparent); }
.featured-card[data-launch="codex"] .featured-info h3 { color: #8b5cf6; }
.featured-card[data-launch="codex"] .featured-tag { border-color: rgba(139,92,246,0.2); color: rgba(139,92,246,0.6); }
.featured-card[data-launch="codex"] .featured-launch { border-color: rgba(139,92,246,0.3); color: #8b5cf6; }
.featured-card[data-launch="codex"]:hover { border-color: rgba(139,92,246,0.2); box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(139,92,246,0.08); }
.featured-card[data-launch="codex"]:hover .featured-launch { background: #8b5cf6; color: #050508; border-color: #8b5cf6; }

/* Gateway — Cyan */
.featured-card[data-launch="gateway-process"] .featured-preview { background: radial-gradient(ellipse at 55% 65%, rgba(34,211,238,0.06), transparent 65%), #050508; }
.featured-card[data-launch="gateway-process"]::before { background: linear-gradient(90deg, transparent, #22d3ee, transparent); }
.featured-card[data-launch="gateway-process"] .featured-info h3 { color: #22d3ee; }
.featured-card[data-launch="gateway-process"] .featured-tag { border-color: rgba(34,211,238,0.2); color: rgba(34,211,238,0.6); }
.featured-card[data-launch="gateway-process"] .featured-launch { border-color: rgba(34,211,238,0.3); color: #22d3ee; }
.featured-card[data-launch="gateway-process"]:hover { border-color: rgba(34,211,238,0.18); box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(34,211,238,0.08); }
.featured-card[data-launch="gateway-process"]:hover .featured-launch { background: #22d3ee; color: #050508; border-color: #22d3ee; }

/* Tech Map — Rose */
.featured-card[data-launch="tech-map"]::before { background: linear-gradient(90deg, transparent, #f43f5e, transparent); }
.featured-card[data-launch="tech-map"] .featured-info h3 { color: #f43f5e; }
.featured-card[data-launch="tech-map"] .featured-tag { border-color: rgba(244,63,94,0.2); color: rgba(244,63,94,0.6); }
.featured-card[data-launch="tech-map"] .featured-launch { border-color: rgba(244,63,94,0.3); color: #f43f5e; }
.featured-card[data-launch="tech-map"]:hover { border-color: rgba(244,63,94,0.18); box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(244,63,94,0.08); }
.featured-card[data-launch="tech-map"]:hover .featured-launch { background: #f43f5e; color: #050508; border-color: #f43f5e; }

/* Frequencies — Amber */
.featured-card[data-launch="electromagnetic"] .featured-preview { background: radial-gradient(ellipse at 55% 65%, rgba(245,158,11,0.06), transparent 65%), #050508; }
.featured-card[data-launch="electromagnetic"]::before { background: linear-gradient(90deg, transparent, #f59e0b, transparent); }
.featured-card[data-launch="electromagnetic"] .featured-info h3 { color: #f59e0b; }
.featured-card[data-launch="electromagnetic"] .featured-tag { border-color: rgba(245,158,11,0.2); color: rgba(245,158,11,0.6); }
.featured-card[data-launch="electromagnetic"] .featured-launch { border-color: rgba(245,158,11,0.3); color: #f59e0b; }
.featured-card[data-launch="electromagnetic"]:hover { border-color: rgba(245,158,11,0.18); box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(245,158,11,0.08); }
.featured-card[data-launch="electromagnetic"]:hover .featured-launch { background: #f59e0b; color: #050508; border-color: #f59e0b; }

/* The Signal — Violet/Amber */
.featured-card[data-launch="the-signal"] .featured-preview { background: radial-gradient(ellipse at 50% 55%, rgba(168,85,247,0.08), rgba(232,121,249,0.04) 45%, transparent 70%), #050508; }
.featured-card[data-launch="the-signal"]::before { background: linear-gradient(90deg, transparent, #a855f7, #e879f9, transparent); }
.featured-card[data-launch="the-signal"] .featured-info h3 { color: #e879f9; }
.featured-card[data-launch="the-signal"] .featured-tag { border-color: rgba(168,85,247,0.25); color: rgba(232,121,249,0.7); }
.featured-card[data-launch="the-signal"] .featured-launch { border-color: rgba(168,85,247,0.35); color: #e879f9; }
.featured-card[data-launch="the-signal"]:hover { border-color: rgba(168,85,247,0.2); box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(168,85,247,0.1); }
.featured-card[data-launch="the-signal"]:hover .featured-launch { background: linear-gradient(135deg, #a855f7, #e879f9); color: #050508; border-color: #e879f9; }

#featured-signal-canvas {
    width: 100%;
    height: 100%;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

/* All Visualizations Grid */
.dashboard-grid { margin-bottom: 56px; }

.viz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.viz-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: rgba(10, 16, 32, 0.55);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border: 1px solid rgba(180, 160, 120, 0.08);
    border-left: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.03);
}

.viz-card:hover {
    transform: translateX(4px);
    background: rgba(18, 20, 36, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

.viz-card-icon {
    font-size: 2rem;
    flex-shrink: 0;
    opacity: 0.55;
    transition: opacity 0.3s ease;
    width: 40px;
    text-align: center;
}

.viz-card:hover .viz-card-icon { opacity: 0.9; }

.viz-card-content { flex: 1; }

.viz-card-content h4 {
    margin-bottom: 3px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: #e8e5de;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.viz-card-content p {
    color: rgba(200, 195, 180, 0.6);
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

.viz-card-type {
    position: absolute;
    top: 8px;
    right: 10px;
    padding: 2px 8px;
    background: rgba(255,255,255,0.02);
    color: rgba(200, 195, 180, 0.45);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 3px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ---- VIZ CARD ACCENT COLORS ---- */

/* Timeline — Rose */
.viz-card[data-launch="timeline"] { border-left-color: rgba(244,63,94,0.4); }
.viz-card[data-launch="timeline"] .viz-card-icon { color: #f43f5e; }
.viz-card[data-launch="timeline"]:hover { border-left-color: #f43f5e; box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 20px rgba(244,63,94,0.08); }

/* Frequencies — Amber */
.viz-card[data-launch="electromagnetic"] { border-left-color: rgba(245,158,11,0.4); }
.viz-card[data-launch="electromagnetic"] .viz-card-icon { color: #f59e0b; }
.viz-card[data-launch="electromagnetic"]:hover { border-left-color: #f59e0b; box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 20px rgba(245,158,11,0.08); }

/* Codex — Violet */
.viz-card[data-launch="codex"] { border-left-color: rgba(139,92,246,0.4); }
.viz-card[data-launch="codex"] .viz-card-icon { color: #8b5cf6; }
.viz-card[data-launch="codex"]:hover { border-left-color: #8b5cf6; box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 20px rgba(139,92,246,0.08); }

/* Gateway — Cyan */
.viz-card[data-launch="gateway-process"] { border-left-color: rgba(34,211,238,0.4); }
.viz-card[data-launch="gateway-process"] .viz-card-icon { color: #22d3ee; }
.viz-card[data-launch="gateway-process"]:hover { border-left-color: #22d3ee; box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 20px rgba(34,211,238,0.08); }

/* Globe — Gold */
.viz-card[data-launch="grid-globe"],
.viz-card.grid-globe-card { border-left-color: rgba(212,175,55,0.4); }
.viz-card[data-launch="grid-globe"] .viz-card-icon,
.viz-card.grid-globe-card .viz-card-icon { color: #d4af37; }
.viz-card[data-launch="grid-globe"]:hover,
.viz-card.grid-globe-card:hover { border-left-color: #d4af37; box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 20px rgba(212,175,55,0.08); }

/* Tech Map — Rose */
.viz-card[data-launch="tech-map"] { border-left-color: rgba(244,63,94,0.25); }
.viz-card[data-launch="tech-map"] .viz-card-icon { color: #f43f5e; }
.viz-card[data-launch="tech-map"]:hover { border-left-color: #f43f5e; box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 20px rgba(244,63,94,0.05); }

/* Node Network — Emerald */
.viz-card[data-launch="node-network"] { border-left-color: rgba(16,185,129,0.25); }
.viz-card[data-launch="node-network"] .viz-card-icon { color: #10b981; }
.viz-card[data-launch="node-network"]:hover { border-left-color: #10b981; box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 20px rgba(16,185,129,0.05); }

/* Dashboard Reading Section */
.dashboard-reading { margin-bottom: 56px; }

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

.reading-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px 22px 20px;
    background: rgba(10, 16, 32, 0.55);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border: 1px solid rgba(180, 160, 120, 0.08);
    border-left: 3px solid var(--accent, rgba(196, 163, 90, 0.4));
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.03);
    text-decoration: none;
    color: inherit;
}

.reading-card:hover {
    transform: translateY(-3px);
    background: rgba(18, 20, 36, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent, #c4a35a);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 20px color-mix(in srgb, var(--accent, #c4a35a) 10%, transparent);
}

.reading-chapter {
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent, rgba(196, 163, 90, 0.5));
    opacity: 0.6;
}

.reading-card h4 {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: #e8e5de;
    font-weight: 500;
    letter-spacing: 0.02em;
    margin: 0;
}

.reading-card p {
    color: rgba(200, 195, 180, 0.55);
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.5;
    flex: 1;
}

.reading-cta {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: var(--accent, #c4a35a);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.reading-card:hover .reading-cta {
    opacity: 1;
}

.reading-begin {
    display: inline-block;
    padding: 0.65rem 1.8rem;
    background: rgba(196, 163, 90, 0.08);
    border: 1px solid rgba(196, 163, 90, 0.2);
    border-radius: 4px;
    color: #c4a35a;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-decoration: none;
    transition: all 0.3s ease;
}

.reading-begin:hover {
    background: rgba(196, 163, 90, 0.15);
    border-color: rgba(196, 163, 90, 0.4);
}

/* Dashboard Insights */
.dashboard-insights { margin-bottom: 48px; }

.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.insight-card {
    background: rgba(10, 16, 32, 0.55);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border: 1px solid rgba(180, 160, 120, 0.08);
    border-radius: 4px;
    padding: 32px 24px;
    text-align: center;
    transition: all 0.4s ease;
    position: relative;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.03);
}

.insight-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    border-color: rgba(255,255,255,0.12);
}

.insight-number {
    font-family: 'Cinzel', serif;
    font-size: 2.8rem;
    font-weight: 700;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 12px;
}

/* Per-insight colors */
.insight-card:nth-child(1) .insight-number { background: linear-gradient(135deg, #f43f5e, #ff6b8a); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.insight-card:nth-child(1)::after { content: ''; position: absolute; bottom: 0; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg, transparent, rgba(244,63,94,0.35), transparent); }

.insight-card:nth-child(2) .insight-number { background: linear-gradient(135deg, #f59e0b, #fbbf24); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.insight-card:nth-child(2)::after { content: ''; position: absolute; bottom: 0; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg, transparent, rgba(245,158,11,0.35), transparent); }

.insight-card:nth-child(3) .insight-number { background: linear-gradient(135deg, #22d3ee, #67e8f9); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.insight-card:nth-child(3)::after { content: ''; position: absolute; bottom: 0; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg, transparent, rgba(34,211,238,0.35), transparent); }

.insight-text {
    color: rgba(200, 195, 180, 0.6);
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Controls */
.controls {
    background-color: var(--panel-glass);
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    border: 1px solid var(--panel-border);
    box-shadow: 0 10px 20px rgba(17, 49, 70, 0.08);
}

.controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.controls input[type="checkbox"] {
    accent-color: var(--accent-color);
}

/* Map Container */
#world-map-container,
#spiral-timeline-container,
#bloodline-tree-container,
#earth-cutaway-container,
#earth-3d-container,
#convergence-3d,
#correlation-matrix,
#antarctica-layers,
#live-map {
    background-color: var(--surface-bg);
    border: none;
    min-height: 500px;
    position: relative;
    overflow: hidden;
    box-shadow: none;
}

/* 3D Earth specific styles */
#earth-3d-container {
    min-height: 600px;
    background: radial-gradient(circle at center, #f6fbff 0%, #d9e6f1 100%);
}

#earth-3d-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.depth-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--panel-glass);
    padding: 20px;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    z-index: 100;
}

.depth-controls h4 {
    color: var(--accent-strong);
    margin-top: 0;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-size: 0.9em;
}

.depth-controls label {
    display: block;
    margin: 5px 0;
    color: var(--text-primary);
    font-size: 0.85em;
}

.depth-controls input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

#earth-info-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--panel-glass);
    padding: 20px;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    display: none;
    max-width: 300px;
    z-index: 100;
}

#earth-info-panel h4 {
    color: var(--accent-strong);
    margin-top: 0;
    margin-bottom: 10px;
}

#earth-info-content {
    color: var(--text-primary);
    font-size: 0.9em;
    line-height: 1.5;
}

#earth-info-content strong {
    color: var(--accent-strong);
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
}

#earth-info-content em {
    display: block;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.95em;
}

/* Info Panels */
.info-panel,
.cycle-info,
.bloodline-stats,
.facility-list,
.moon-anomalies,
.probability-calc {
    background-color: var(--secondary-bg);
    border: 1px solid var(--grid-color);
    padding: 20px;
    margin-top: 20px;
}

.info-panel h4,
.cycle-info h4,
.bloodline-stats h4,
.facility-list h4,
.moon-anomalies h4,
.probability-calc h4 {
    color: var(--accent-color);
    margin-bottom: 15px;
    text-transform: uppercase;
}

/* Timeline Controls */
.timeline-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background-color: var(--secondary-bg);
    margin-top: 20px;
}

#timeline-slider {
    flex: 1;
    accent-color: var(--accent-color);
}

#play-timeline {
    background-color: var(--accent-color);
    color: var(--primary-bg);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
}

/* Countdown */
.countdown {
    text-align: center;
    margin-top: 20px;
    padding: 20px;
    background-color: var(--primary-bg);
    border: 2px solid var(--warning-color);
}

.countdown-time {
    font-size: 2em;
    color: var(--warning-color);
    font-weight: bold;
    display: block;
    margin-top: 10px;
}

/* Live Feeds */
.live-feeds {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feed {
    background-color: var(--secondary-bg);
    border: 1px solid var(--grid-color);
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.feed h4 {
    color: var(--accent-color);
    margin-bottom: 10px;
    font-size: 0.9em;
    text-transform: uppercase;
}

.feed-content {
    font-size: 0.8em;
    line-height: 1.4;
}

/* Acceleration Meter */
.acceleration-meter {
    margin-top: 30px;
    padding: 20px;
    background-color: var(--secondary-bg);
    border: 2px solid var(--warning-color);
}

.meter {
    width: 100%;
    height: 30px;
    background-color: var(--primary-bg);
    border: 1px solid var(--warning-color);
    margin: 15px 0;
    position: relative;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--warning-color));
    transition: width 0.5s;
    position: relative;
}

.meter-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Footer */
footer {
    background-color: var(--secondary-bg);
    padding: 30px;
    text-align: center;
    border-top: 2px solid var(--accent-color);
    margin-top: 50px;
}

footer p {
    margin: 10px 0;
}

.disclaimer {
    font-size: 0.8em;
    color: var(--text-secondary);
    font-style: italic;
}

/* ============================================
   RESPONSIVE TYPOGRAPHY & LAYOUT
   Award-winning mobile-first scaling
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .featured-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Mobile */
@media (max-width: 768px) {
    h1 {
        font-size: var(--fs-3xl, 2rem);
        letter-spacing: 0.02em;
    }

    h2 {
        font-size: var(--fs-2xl, 1.5rem);
        letter-spacing: 0.01em;
    }

    .status-bar {
        flex-direction: column;
        gap: 10px;
    }

    .nav-btn {
        font-size: 0.8em;
        padding: 8px 15px;
    }

    /* Dashboard section headings - elegant scaling */
    .dashboard-featured h2,
    .dashboard-grid h2,
    .dashboard-reading h2,
    .dashboard-insights h2 {
        font-size: var(--fs-xl, 1.5rem);
        padding: 0 1rem;
        letter-spacing: 0.02em;
        line-height: 1.3;
        text-align: center;
    }

    .featured-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 0.5rem;
    }

    .featured-card {
        margin: 0;
    }

    .featured-info h3 {
        font-size: 1.1rem;
    }

    .featured-info p {
        font-size: 0.875rem;
        line-height: 1.5;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .dashboard-featured h2,
    .dashboard-grid h2,
    .dashboard-reading h2,
    .dashboard-insights h2 {
        font-size: var(--fs-lg, 1.25rem);
        padding: 0 0.75rem;
    }

    .featured-preview {
        height: 120px;
    }

    .featured-info {
        padding: 16px;
    }

    .featured-info h3 {
        font-size: 1rem;
    }

    .featured-launch {
        bottom: 16px;
        right: 16px;
        padding: 8px 16px;
        font-size: 0.75rem;
    }
}

/* Very small mobile (375px and below) */
@media (max-width: 390px) {
    .dashboard-featured h2,
    .dashboard-grid h2,
    .dashboard-reading h2,
    .dashboard-insights h2 {
        font-size: 1.1rem;
        letter-spacing: 0.03em;
    }

    .featured-grid {
        gap: 12px;
    }

    .featured-preview {
        height: 100px;
    }

    .featured-icon {
        font-size: 2.5rem;
    }
}

/* Ley line animation for activating lines */
@keyframes dash {
    to {
        stroke-dashoffset: -10;
    }
}

/* Special Effects */
.glowing {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 10px var(--glow-color), 0 0 20px var(--glow-color); }
    to { text-shadow: 0 0 20px var(--glow-color), 0 0 40px var(--glow-color); }
}

.pulsing {
    animation: pulse-scale 1s ease-in-out infinite;
}

@keyframes pulse-scale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Population Genetics Visualization Styles */
#population-genetics-container {
    width: 100%;
    height: 600px;
    background: var(--primary-bg);
    border: 1px solid var(--grid-color);
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.genetics-controls {
    background: var(--secondary-bg);
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.genetics-controls h4 {
    margin-bottom: 10px;
    color: var(--accent-color);
}

.genetics-controls label {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
    cursor: pointer;
}

.genetics-controls input[type="checkbox"] {
    margin-right: 5px;
    cursor: pointer;
}

.genetics-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
    padding: 20px;
    background: var(--secondary-bg);
    border-radius: 5px;
}

.info-column h4 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.info-column ul {
    list-style: none;
    padding: 0;
}

.info-column li {
    padding: 5px 0;
    color: var(--text-primary);
    font-size: 0.9em;
    border-bottom: 1px solid var(--grid-color);
}

.info-column li:last-child {
    border-bottom: none;
}

/* Genetics visualization specific elements */
.migration-paths path {
    transition: stroke-width 0.3s ease;
}

.origin-point {
    cursor: pointer;
    transition: r 0.3s ease;
}

.diversity-hotspot {
    pointer-events: all;
    cursor: pointer;
}

.rh-marker {
    cursor: pointer;
    transition: r 0.3s ease;
}

.haplogroup-distribution path {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.civilization-connection {
    cursor: pointer;
    transition: all 0.3s ease;
}

.migration-timeline {
    background: var(--panel-glass);
    border: 1px solid var(--panel-border);
    border-radius: 5px;
    padding: 10px;
}

.timeline-axis {
    font-size: 12px;
}

.timeline-event {
    cursor: pointer;
    transition: r 0.3s ease;
}

.timeline-event:hover {
    r: 5;
}

.time-period {
    cursor: pointer;
}

.legend {
    background: var(--panel-glass);
    border: 1px solid var(--panel-border);
    border-radius: 5px;
    padding: 15px;
}

.genetics-tooltip {
    max-width: 300px;
    word-wrap: break-word;
}

/* Evidence Correlation Matrix Styles */
.evidence-matrix-container {
    position: relative;
    width: 100%;
    min-height: 600px;
    background: var(--secondary-bg);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 18px 32px rgba(17, 49, 70, 0.12);
}

.matrix-controls {
    background: var(--panel-glass);
    border: 1px solid var(--panel-border);
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.matrix-controls h3 {
    color: var(--accent-strong);
    margin-bottom: 15px;
    font-size: 1.2em;
}

.control-group {
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    color: var(--text-primary);
    font-size: 14px;
}

.control-group input[type="range"] {
    width: 200px;
    height: 5px;
    background: var(--grid-color);
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    background: var(--accent-color);
    cursor: pointer;
    border-radius: 50%;
}

.control-group input[type="checkbox"] {
    margin-right: 5px;
}

#threshold-value {
    color: var(--accent-color);
    font-weight: bold;
    margin-left: 10px;
}

.matrix-viz-container {
    text-align: center;
    margin: 20px 0;
}

.matrix-cell {
    cursor: pointer;
    transition: all 0.3s ease;
}

.matrix-cell.selected .cell-bg {
    fill: rgba(29, 143, 191, 0.1);
    stroke: var(--accent-color);
    stroke-width: 2;
}

.matrix-cell.dimmed {
    opacity: 0.2;
}

.matrix-cell.highlighted {
    opacity: 1;
}

.matrix-cell.highlighted .correlation-indicator {
    filter: drop-shadow(0 0 5px var(--glow-color));
}

.correlation-indicator {
    transition: all 0.3s ease;
}

.significance-marker {
    pointer-events: none;
}

.temporal-indicator {
    pointer-events: none;
    opacity: 0.8;
    animation: pulse 2s infinite;
}

.matrix-tooltip {
    background: var(--panel-glass);
    border: 1px solid var(--panel-border);
    border-radius: 5px;
    padding: 10px;
    color: var(--text-primary);
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
}

.matrix-details-panel {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 400px;
    background: var(--panel-glass);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 18px 32px rgba(17, 49, 70, 0.18);
    z-index: 100;
}

.matrix-details-panel h3 {
    color: var(--accent-strong);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.matrix-details-panel h4 {
    color: var(--accent-strong);
    margin: 15px 0 10px 0;
    font-size: 1.1em;
}

.correlation-info p {
    margin: 10px 0;
    color: var(--text-primary);
}

.correlation-info strong {
    color: var(--accent-strong);
}

.evidence-list ul {
    list-style: none;
    padding: 0;
}

.evidence-list li {
    margin: 10px 0;
    padding: 10px;
    background: rgba(29, 143, 191, 0.05);
    border-left: 3px solid var(--accent-color);
    font-size: 13px;
}

.evidence-type {
    color: var(--pulse-color);
    font-weight: bold;
}

.evidence-list a {
    color: var(--accent-color);
    text-decoration: none;
}

.evidence-list a:hover {
    text-decoration: underline;
}

.evidence-date {
    color: var(--text-secondary);
    font-size: 11px;
    margin-left: 5px;
}

.temporal-chart svg {
    background: rgba(240, 248, 255, 0.6);
    border-radius: 5px;
}

.temporal-chart text {
    fill: var(--text-secondary);
    font-size: 10px;
}

.close-details {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: 1px solid var(--panel-border);
    color: var(--accent-strong);
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.close-details:hover {
    background: var(--accent-color);
    color: var(--accent-contrast);
}

.matrix-legend {
    margin-top: 30px;
    padding: 20px;
    background: var(--panel-glass);
    border: 1px solid var(--panel-border);
    border-radius: 5px;
}

.matrix-legend h4 {
    color: var(--accent-strong);
    margin-bottom: 15px;
}

.color-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.gradient-bar {
    width: 200px;
    height: 20px;
    border-radius: 3px;
}

.symbol-legend div {
    margin: 10px 0;
    color: var(--text-primary);
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-style: italic;
}

/* World Map Enhancements */
#world-map-container {
    position: relative;
}

.zoom-controls {
    background: rgba(26, 35, 50, 0.9);
    border: 1px solid var(--accent-color);
    border-radius: 5px;
    padding: 5px;
}

.zoom-controls button {
    background: var(--secondary-bg);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 5px 10px;
    margin: 2px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
}

.zoom-controls button:hover {
    background: var(--accent-color);
    color: var(--primary-bg);
    box-shadow: 0 0 10px var(--accent-color);
}

.map-legend {
    pointer-events: none;
}

.map-legend text {
    font-family: var(--font-mono);
    text-shadow: 0 0 3px rgba(15, 36, 50, 0.2);
}

/* Enhanced Northeast Detail Styles */
.ne-location {
    transition: all 0.3s;
}

.ne-location.vortex {
    animation: vortex-pulse 3s infinite;
}

@keyframes vortex-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.hudson-channel {
    animation: energy-flow 5s linear infinite;
}

.appalachian-spine {
    animation: energy-flow 7s linear infinite;
}

@keyframes energy-flow {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -100; }
}

/* Energy flow animation */
.energy-flow-layer path {
    mix-blend-mode: screen;
}

/* Fallback for browsers without mix-blend-mode support */
@supports not (mix-blend-mode: screen) {
    .energy-flow-layer path {
        opacity: 0.7;
    }
}

/* Map tooltips */
.map-tooltip {
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(29, 143, 191, 0.5);
}

/* Regional ley lines */
.regional-ley-line {
    pointer-events: visibleStroke;
    cursor: pointer;
}

.regional-ley-line:hover {
    stroke-width: 3;
    filter: drop-shadow(0 0 10px var(--accent-color));
}

/* Animation for dash patterns */
@keyframes dash {
    to {
        stroke-dashoffset: -10;
    }
}

/* Sound Control Panel Styles */
#sound-control-container {
    width: 100%;
    min-height: 500px;
}

.sound-control-panel {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Master Play Button */
.master-play-section {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 40px;
    background: var(--secondary-bg);
    border-radius: 10px;
    border: 1px solid var(--grid-color);
    transition: all 0.5s ease;
}

.sound-system-active .master-play-section {
    background: radial-gradient(circle at center, rgba(29, 143, 191, 0.1) 0%, var(--secondary-bg) 100%);
    border-color: var(--accent-color);
    box-shadow: 0 0 30px rgba(29, 143, 191, 0.3);
}

#master-play-btn {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--primary-bg);
    border: 3px solid var(--accent-color);
    color: var(--accent-color);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.5s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#master-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px var(--accent-color);
}

#master-play-btn.active {
    background: radial-gradient(circle at center, var(--accent-color) 0%, rgba(29, 143, 191, 0.5) 100%);
    color: var(--primary-bg);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 20px var(--accent-color); }
    50% { box-shadow: 0 0 60px var(--accent-color), 0 0 100px rgba(29, 143, 191, 0.5); }
    100% { box-shadow: 0 0 20px var(--accent-color); }
}

.play-icon, .pause-icon {
    font-size: 48px;
}

.pause-icon {
    display: none;
}

.btn-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.play-description {
    margin-top: 20px;
    color: var(--text-secondary);
    font-style: italic;
    transition: color 0.5s ease;
}

.sound-system-active .play-description {
    color: var(--accent-color);
}

/* Master Controls */
#master-controls {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--secondary-bg);
    border-radius: 10px;
    transition: all 0.5s ease;
}

#master-controls.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.sound-system-active #master-controls {
    opacity: 1;
    pointer-events: auto;
    background: rgba(26, 26, 26, 0.9);
    border: 1px solid rgba(29, 143, 191, 0.3);
}

.master-volume {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
}

.master-volume label {
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#master-volume {
    width: 300px;
}

#master-volume-value {
    color: var(--accent-color);
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

/* Sound Categories */
#sound-categories {
    transition: all 0.5s ease;
}

#sound-categories.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.sound-system-active #sound-categories {
    opacity: 1;
    pointer-events: auto;
}

.sound-category {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--secondary-bg);
    border-radius: 10px;
    border: 1px solid var(--grid-color);
    transition: all 0.3s ease;
}

.sound-system-active .sound-category {
    border-color: rgba(29, 143, 191, 0.2);
}

.sound-category h3 {
    color: var(--accent-color);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sound-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.sound-item {
    background: var(--primary-bg);
    border: 1px solid var(--grid-color);
    border-radius: 5px;
    padding: 15px;
    transition: all 0.3s ease;
}

.sound-item.active {
    background: rgba(29, 143, 191, 0.1);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(29, 143, 191, 0.3);
}

.sound-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sound-name {
    color: var(--text-primary);
    font-weight: bold;
}

.sound-toggle {
    background: var(--primary-bg);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.sound-toggle:hover {
    background: var(--accent-color);
    color: var(--primary-bg);
}

.sound-toggle.active {
    background: var(--accent-color);
    color: var(--primary-bg);
}

.sound-info {
    color: var(--text-secondary);
    font-size: 0.9em;
    line-height: 1.4;
}

/* Sound system active state animations */
.sound-system-active {
    animation: system-activate 1s ease-out;
}

@keyframes system-activate {
    0% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3);
    }
    100% {
        filter: brightness(1);
    }
}

/* Floating panel mode (legacy) */
.sound-control-panel.floating {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 350px;
    max-height: 80vh;
    background: var(--panel-glass);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    z-index: 1000;
    box-shadow: 0 18px 32px rgba(17, 49, 70, 0.2);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Prevent panel from blocking body scroll on mobile */
    pointer-events: auto;
}

/* Ensure body can scroll on mobile when panel is open */
@media (max-width: 768px) {
    .sound-control-panel.floating {
        position: absolute;
        width: calc(100% - 40px);
        right: 10px;
        left: 10px;
        top: 60px;
        max-height: 70vh;
    }
}

/* ============================================
   CODEX UNIVERSALIS STYLES
   ============================================ */

/* Special nav button for Codex */
.nav-btn.codex-special {
    background: linear-gradient(135deg, var(--accent-color), var(--pulse-color));
    color: var(--accent-contrast);
    border-color: var(--pulse-color);
    font-weight: 600;
}

.nav-btn.codex-special:hover {
    box-shadow: 0 0 20px var(--pulse-color);
    transform: translateY(-2px);
}

/* Special nav button for Transmission */
.nav-btn.transmission-special {
    background: linear-gradient(135deg, #ffd700, #00ffcc);
    color: #000;
    border-color: #ffd700;
    font-weight: 600;
}

.nav-btn.transmission-special:hover {
    box-shadow: 0 0 20px #ffd700, 0 0 30px #00ffcc;
    transform: translateY(-2px);
}

/* Special nav button for Quantum Symphony */
.nav-btn.quantum-special {
    background: linear-gradient(135deg, #7b2ff7, #00d9ff);
    color: #fff;
    border-color: #7b2ff7;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-btn.quantum-special:hover {
    box-shadow: 0 0 20px #7b2ff7, 0 0 30px #00d9ff;
    transform: translateY(-2px);
}

/* Transmission card special styling */
.viz-card.transmission-card {
    border-color: rgba(255, 215, 0, 0.3);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(0, 255, 204, 0.05));
}

.viz-card.transmission-card:hover {
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3), 0 0 50px rgba(0, 255, 204, 0.2);
}

/* Codex Controls Panel */
.codex-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.codex-controls .control-group {
    min-width: 0; /* Prevent grid blowout */
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(29, 143, 191, 0.2);
    overflow: hidden;
    box-sizing: border-box;
}

.codex-controls h4 {
    color: var(--accent-color);
    margin-bottom: 10px;
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.codex-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
}

.codex-stats strong {
    color: var(--accent-color);
}

.codex-controls label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: var(--fs-sm);
}

.codex-mode-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.codex-time-controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

.codex-time-controls label {
    display: block;
    margin-bottom: 4px;
}

.codex-time-controls .codex-action-btn {
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
    padding: 8px 10px;
}

#codex-time {
    background: var(--primary-bg);
    color: var(--text-primary);
    border: 1px solid var(--grid-color);
    padding: 6px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.mode-label {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: var(--fs-sm);
}

.codex-note {
    margin-top: 6px;
    font-size: var(--fs-xs);
    color: var(--text-secondary);
}

.codex-controls input[type="checkbox"] {
    margin-right: 8px;
    accent-color: var(--accent-color);
}

.codex-action-btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 8px 12px;
    margin-bottom: 8px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.03em;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.codex-action-btn:hover {
    background: var(--accent-color);
    color: var(--primary-bg);
    box-shadow: 0 0 15px rgba(29, 143, 191, 0.5);
}

.codex-action-btn.primary {
    background: var(--accent-color);
    color: var(--primary-bg);
}

.codex-action-btn.primary:hover {
    background: var(--pulse-color);
    border-color: var(--pulse-color);
}

/* Codex Info Columns */
.codex-info {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.codex-info .info-column {
    flex: 1;
    min-width: 280px;
    background: rgba(10, 10, 10, 0.8);
    padding: 20px;
    border: 1px solid var(--grid-color);
    border-radius: 8px;
}

.codex-info h4 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: var(--fs-md);
    text-transform: uppercase;
}

.codex-info ul {
    list-style: none;
}

.codex-info li {
    padding: 8px 0;
    border-bottom: 1px solid var(--grid-color);
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.codex-info li:last-child {
    border-bottom: none;
}

.codex-info li strong {
    color: var(--accent-color);
}

.codex-info .accuracy {
    color: var(--pulse-color);
    font-size: var(--fs-xs);
}

/* Document Modal - High Contrast Dark Theme */
.codex-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.codex-modal.hidden {
    display: none;
}

.codex-modal .modal-backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
}

.codex-modal .modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: #0a0a12;
    border: 1px solid rgba(29, 143, 191, 0.4);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(29, 143, 191, 0.15);
}

.codex-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(29, 143, 191, 0.3);
    background: linear-gradient(180deg, #0d1520 0%, #0a0a12 100%);
}

.codex-modal .modal-header h2 {
    margin: 0;
    color: #1d8fbf;
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px rgba(29, 143, 191, 0.5);
}

.codex-modal .close-modal {
    background: none;
    border: none;
    color: #8899aa;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
}

.codex-modal .close-modal:hover {
    color: #1d8fbf;
    text-shadow: 0 0 10px rgba(29, 143, 191, 0.5);
}

.codex-modal .modal-body {
    padding: 30px 35px;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
    background: #0a0a12;
    color: #e0e8f0;
    font-size: 1rem;
    line-height: 1.7;
}

/* Scrollbar styling for modal */
.codex-modal .modal-body::-webkit-scrollbar {
    width: 8px;
}

.codex-modal .modal-body::-webkit-scrollbar-track {
    background: #0a0a12;
}

.codex-modal .modal-body::-webkit-scrollbar-thumb {
    background: rgba(29, 143, 191, 0.4);
    border-radius: 4px;
}

.codex-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(29, 143, 191, 0.6);
}

.codex-document h1 {
    color: #1d8fbf;
    border-bottom: 2px solid rgba(29, 143, 191, 0.5);
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-size: 1.8rem;
    text-shadow: 0 0 15px rgba(29, 143, 191, 0.3);
}

.codex-document h2 {
    color: #00d4aa;
    margin-top: 35px;
    margin-bottom: 15px;
    font-size: 1.4rem;
    text-shadow: 0 0 10px rgba(0, 212, 170, 0.3);
}

.codex-document h3 {
    color: #8b9dc3;
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.codex-document p {
    margin-bottom: 1.2em;
    line-height: 1.8;
    color: #d0dae5;
}

.codex-document strong {
    color: #1d8fbf;
    font-weight: 600;
}

.codex-document em {
    color: #00d4aa;
    font-style: italic;
}

.codex-document ul {
    margin-left: 25px;
    margin-bottom: 1.2em;
}

.codex-document li {
    margin-bottom: 0.6em;
    color: #c5d0dc;
}

.codex-document li::marker {
    color: #1d8fbf;
}

.codex-document a {
    color: #1d8fbf;
    text-decoration: underline;
    text-decoration-color: rgba(29, 143, 191, 0.4);
    transition: all 0.3s;
}

.codex-document a:hover {
    color: #00d4aa;
    text-decoration-color: rgba(0, 212, 170, 0.6);
}

.codex-document strong {
    color: var(--accent-color);
}

/* Codex Tables */
.codex-table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    background: rgba(10, 15, 25, 0.8);
    border: 1px solid rgba(29, 143, 191, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.codex-table thead {
    background: linear-gradient(180deg, rgba(29, 143, 191, 0.25) 0%, rgba(29, 143, 191, 0.15) 100%);
}

.codex-table th {
    padding: 14px 18px;
    text-align: left;
    color: #1d8fbf;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(29, 143, 191, 0.4);
}

.codex-table td {
    padding: 12px 18px;
    color: #c5d0dc;
    border-bottom: 1px solid rgba(29, 143, 191, 0.15);
    font-size: 0.95rem;
}

.codex-table tbody tr:hover {
    background: rgba(29, 143, 191, 0.08);
}

.codex-table tbody tr:last-child td {
    border-bottom: none;
}

.codex-table td strong {
    color: #00d4aa;
}

/* Codex Code Blocks (ASCII Art) */
.codex-code-block {
    background: linear-gradient(180deg, rgba(5, 10, 20, 0.95) 0%, rgba(10, 15, 25, 0.95) 100%);
    border: 1px solid rgba(29, 143, 191, 0.3);
    border-radius: 8px;
    padding: 20px 25px;
    margin: 25px 0;
    overflow-x: auto;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.codex-code-block code {
    font-family: 'Fira Code', 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #00d4aa;
    white-space: pre;
    display: block;
}

/* Codex Horizontal Rule */
.codex-hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(29, 143, 191, 0.5) 20%,
        rgba(0, 212, 170, 0.5) 50%,
        rgba(29, 143, 191, 0.5) 80%,
        transparent 100%);
    margin: 40px 0;
}

/* Codex Lists */
.codex-list {
    margin: 15px 0 20px 25px;
    padding: 0;
}

.codex-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    color: #c5d0dc;
}

.codex-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: #1d8fbf;
}

/* Codex H4 */
.codex-document h4 {
    color: #8b9dc3;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Convergence Overlay */
#codex-convergence-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(226, 238, 247, 0.96);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.convergence-number {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: bold;
    color: var(--pulse-color);
    margin: 10px 0;
    transition: all 0.5s ease;
    text-shadow: 0 0 20px var(--pulse-color);
}

.convergence-final {
    font-size: 15rem;
    color: var(--accent-color);
    text-shadow: 0 0 50px var(--accent-color), 0 0 100px var(--accent-color);
    animation: convergence-pulse 0.833s infinite;
}

@keyframes convergence-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

.convergence-text {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-top: 50px;
    text-align: center;
}

/* Info Panel */
#codex-info-panel {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 320px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 20px;
    display: none;
    z-index: 100;
    box-shadow: 0 0 30px rgba(29, 143, 191, 0.3);
}

#codex-info-panel.visible {
    display: block;
}

#codex-info-panel .close-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

#codex-info-panel .close-panel:hover {
    color: var(--accent-color);
}

#codex-info-panel .number-display {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--accent-color);
    text-shadow: 0 0 20px var(--accent-color);
}

#codex-info-panel .derivation {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    margin-bottom: 20px;
}

#codex-info-panel .info-section {
    margin-bottom: 20px;
}

#codex-info-panel .info-section h4 {
    color: var(--pulse-color);
    font-size: var(--fs-sm);
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 0.1em;
}

#codex-info-panel .digital-root-calc {
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    padding: 10px;
    background: rgba(240, 248, 255, 0.7);
    border-radius: 4px;
}

#codex-info-panel .culture-list,
#codex-info-panel .validation-list {
    list-style: none;
}

#codex-info-panel .culture-list li,
#codex-info-panel .validation-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--grid-color);
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-sm);
}

#codex-info-panel .highlight {
    color: var(--accent-color);
    font-weight: bold;
}

#codex-mode-banner {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--panel-glass);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    pointer-events: none;
    z-index: 5;
}

#codex-mode-banner .mode {
    color: var(--accent-color);
}

#codex-mode-banner .timestamp {
    color: var(--text-secondary);
}

#codex-earth-panel {
    max-width: 420px;
}

#codex-earth-panel .earth-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

#codex-earth-panel .site-name {
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    color: var(--accent-color);
}

#codex-earth-panel .coords,
#codex-earth-panel .time-display {
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    color: var(--text-secondary);
}

#codex-earth-panel .earth-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#codex-earth-panel .fact-line {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
}

#codex-earth-panel .description {
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--text-primary);
}

#codex-earth-panel .solar-block {
    padding: 10px;
    border: 1px solid var(--grid-color);
    border-radius: 6px;
    background: rgba(29, 143, 191, 0.05);
}

#codex-earth-panel .solar-status {
    color: var(--accent-color);
    font-weight: 700;
}

#codex-earth-panel .solar-angles {
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
}

#codex-earth-panel h5 {
    margin: 6px 0;
    color: var(--accent-color);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

#codex-earth-panel .alignment-list {
    list-style: disc;
    padding-left: 18px;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Tablet Responsive for Codex */
@media (max-width: 1024px) {
    .codex-controls {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
    }
}

/* Mobile Responsive for Codex */
@media (max-width: 768px) {
    .codex-controls {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }

    .codex-controls .control-group {
        padding: 12px;
    }

    .codex-action-btn {
        font-size: 0.7rem;
        padding: 6px 10px;
    }

    .codex-info {
        flex-direction: column;
    }

    .codex-info .info-column {
        min-width: 100%;
    }

    #codex-info-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        transform: none;
        border-radius: 8px 8px 0 0;
        max-height: 50vh;
        overflow-y: auto;
    }

    .convergence-final {
        font-size: 8rem;
    }

    .convergence-text {
        font-size: 1.2rem;
        padding: 0 20px;
    }
}

/* ============================================
   CODEX INTERACTIVE EXPLORER
   ============================================ */

.codex-explorer {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 380px;
    max-height: 80vh;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    overflow: hidden;
    z-index: 200;
    box-shadow: 0 0 40px rgba(29, 143, 191, 0.3);
    display: none;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.codex-explorer.visible {
    display: block;
    animation: slideInLeft 0.4s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.codex-explorer .close-explorer {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 10;
    transition: all 0.3s;
}

.codex-explorer .close-explorer:hover {
    background: var(--accent-color);
    color: var(--primary-bg);
}

.explorer-header {
    padding: 30px 25px 20px;
    background: linear-gradient(180deg, rgba(29, 143, 191, 0.15), transparent);
    text-align: center;
}

.explorer-header .number-hero {
    font-family: var(--font-display);
    font-size: 3.5rem;
    color: var(--accent-color);
    text-shadow: 0 0 30px var(--accent-color);
    letter-spacing: 2px;
}

.digital-root-badge {
    display: inline-block;
    padding: 5px 15px;
    background: var(--pulse-color);
    color: white;
    border-radius: 20px;
    font-size: var(--fs-sm);
    margin-top: 10px;
    font-family: var(--font-mono);
}

.explorer-tabs {
    display: flex;
    border-bottom: 1px solid var(--grid-color);
}

.explorer-tabs .tab-btn {
    flex: 1;
    padding: 12px 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.explorer-tabs .tab-btn:hover {
    color: var(--text-primary);
    background: rgba(29, 143, 191, 0.05);
}

.explorer-tabs .tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.explorer-content {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.explorer-content::-webkit-scrollbar {
    width: 6px;
}

.explorer-content::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

.explorer-content::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.monument-list,
.bio-resonance-list,
.myth-reference-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.monument-list li,
.bio-resonance-list li,
.myth-reference-list li {
    padding: 12px 15px;
    margin-bottom: 10px;
    background: rgba(29, 143, 191, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
}

.monument-list li strong,
.bio-resonance-list li strong,
.myth-reference-list li strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.monument-list .relationship,
.monument-list .note,
.bio-resonance-list .value,
.bio-resonance-list .note {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
}

.myth-reference-list .culture {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-color);
    color: var(--primary-bg);
    border-radius: 4px;
    font-size: var(--fs-xs);
    margin-bottom: 5px;
}

.myth-reference-list .source {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    font-style: italic;
    margin-top: 5px;
}

.connection-strength-bar {
    height: 4px;
    background: var(--grid-color);
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}

.connection-strength-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--pulse-color));
    border-radius: 2px;
    transition: width 0.5s ease-out;
}

.no-data {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Math tab */
.math-section {
    margin-bottom: 20px;
}

.math-section h5 {
    color: var(--accent-color);
    font-size: var(--fs-sm);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.digital-calc {
    font-family: var(--font-mono);
    color: var(--text-primary);
    background: rgba(240, 248, 255, 0.6);
    padding: 10px;
    border-radius: 6px;
    font-size: var(--fs-sm);
}

.derivation {
    font-family: var(--font-mono);
    color: var(--pulse-color);
}

.derived-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.derived-number {
    padding: 5px 12px;
    background: rgba(121, 198, 255, 0.2);
    border: 1px solid var(--pulse-color);
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    color: var(--pulse-color);
}

.math-section.special {
    background: rgba(29, 143, 191, 0.1);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--accent-color);
}

.special-property {
    font-family: var(--font-mono);
    color: var(--accent-color);
}

/* ============================================
   PROFILE CALCULATOR MODAL
   ============================================ */

.profile-modal .modal-content {
    max-width: 700px;
}

.profile-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: var(--accent-color);
    margin-bottom: 8px;
    font-family: var(--font-heading);
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input {
    padding: 12px 15px;
    background: var(--primary-bg);
    border: 1px solid var(--grid-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(29, 143, 191, 0.2);
}

.calculate-btn {
    grid-column: span 2;
    padding: 15px;
    background: var(--accent-color);
    border: none;
    border-radius: 8px;
    color: var(--primary-bg);
    font-family: var(--font-heading);
    font-size: var(--fs-base);
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s;
}

.calculate-btn:hover {
    background: var(--pulse-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139, 124, 255, 0.3);
}

.profile-results {
    padding-top: 20px;
}

.profile-results.hidden {
    display: none;
}

.profile-section {
    background: rgba(29, 143, 191, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--grid-color);
}

.profile-section h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: var(--fs-lg);
}

.profile-stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--grid-color);
}

.profile-stat:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.birth-number-display {
    font-size: 5rem;
    font-family: var(--font-display);
    text-align: center;
    color: var(--accent-color);
    text-shadow: 0 0 30px var(--accent-color);
    line-height: 1;
    margin-bottom: 10px;
}

.birth-number-display.precessional {
    color: var(--pulse-color);
    text-shadow: 0 0 40px var(--pulse-color);
}

.birth-number-title {
    text-align: center;
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    color: var(--text-primary);
    margin-bottom: 5px;
}

.birth-number-desc {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.birth-number-calc {
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    color: var(--text-muted);
    text-align: center;
}

.birth-number-calc div {
    margin: 3px 0;
}

.precessional-badge {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 8px;
    background: linear-gradient(90deg, var(--pulse-color), var(--accent-color));
    color: white;
    border-radius: 6px;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 15px;
    animation: pulse-glow 2s infinite;
}

.profile-results .monument-list li .distance {
    float: right;
    color: var(--accent-color);
    font-family: var(--font-mono);
}

.profile-summary {
    padding: 20px;
    background: linear-gradient(135deg, rgba(29, 143, 191, 0.1), rgba(139, 124, 255, 0.1));
    border-radius: 12px;
    border: 1px solid var(--accent-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ============================================
   MOBILE RESPONSIVE - EXPLORER & PROFILE
   ============================================ */

@media (max-width: 768px) {
    .codex-explorer {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        transform: none;
        width: 100%;
        max-height: 60vh;
        border-radius: 20px 20px 0 0;
    }

    .codex-explorer.visible {
        animation: slideInUp 0.4s ease-out;
    }

    @keyframes slideInUp {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .explorer-header .number-hero {
        font-size: 2.5rem;
    }

    .explorer-tabs .tab-btn {
        font-size: 0.65rem;
        padding: 10px 5px;
    }

    .explorer-content {
        max-height: 300px;
    }

    .profile-form {
        grid-template-columns: 1fr;
    }

    .calculate-btn {
        grid-column: span 1;
    }

    .birth-number-display {
        font-size: 4rem;
    }

    .profile-modal .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ============================================
   VISUALIZATION CONTAINER OVERFLOW FIXES
   Added to prevent horizontal scrolling and fix positioning
   ============================================ */

/* Main visualization container - prevent overflow */
#visualization-container {
    overflow: hidden;
    position: relative;
    max-width: 100%;
}

/* All visualization sections - prevent overflow */
.viz-section {
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

/* Timeline / Galactic Cycles (#timeline) */
#timeline {
    position: relative;
    overflow: visible !important;
}

#spiral-timeline-container {
    position: relative;
    width: 100%;
    min-height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible !important;
}

#spiral-timeline-container svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Global Energy Grid Map (#grid-map) */
#grid-map {
    position: relative;
    overflow: hidden;
}

#world-map-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

#world-map-container svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Earth Structure / Underground (#underground) */
#underground {
    position: relative;
    overflow: hidden;
}

#earth-3d-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

/* Antarctic Revelation (#antarctica) */
#antarctica {
    position: relative;
    overflow: hidden;
}

#antarctica-layers {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    min-height: 500px;
}

/* Leaflet map specific fixes */
#antarctica-layers .leaflet-container {
    width: 100%;
    height: 100%;
    min-height: 500px;
}

/* Lunar Dynamics / Moon (#moon) */
#moon {
    position: relative;
    overflow: hidden;
}

#moon-control-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    min-height: 600px;
}

#moon-control-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
}

/* Genetic Distribution (#bloodlines) */
#bloodlines {
    position: relative;
    overflow: hidden;
}

#bloodline-tree-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    min-height: 500px;
}

#bloodline-tree-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
}

/* Population Genetics (#population-genetics) */
#population-genetics {
    position: relative;
    overflow: hidden;
}

#population-genetics-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
}

/* EM Symphony / Electromagnetic (#electromagnetic) */
#electromagnetic {
    position: relative;
    overflow: hidden;
}

#universal-sound-generator {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

/* Evidence Matrix (#evidence) */
#evidence {
    position: relative;
    overflow: hidden;
}

#evidence-container,
.evidence-matrix-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

#evidence-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
}

/* Master Convergence (#convergence) */
#convergence {
    position: relative;
    overflow: hidden;
}

#master-convergence-container,
#convergence-3d {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

#master-convergence-container canvas,
#convergence-3d canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
}

/* The Codex (#codex) */
#codex {
    position: relative;
    overflow: hidden;
}

#codex-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

#codex-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
}

/* Live Tracker (#live) */
#live {
    position: relative;
    overflow: hidden;
}

#live-tracker,
#live-map {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

#live-tracker canvas,
#live-tracker svg,
#live-map canvas,
#live-map svg {
    display: block;
    max-width: 100%;
}

/* Canvas elements general fix */
.viz-section canvas {
    display: block;
    max-width: 100%;
}

/* SVG elements general fix */
.viz-section svg {
    display: block;
    max-width: 100%;
    overflow: visible;
}

/* Z-index stacking for visualization overlays */
.viz-section .controls,
.viz-section .info-panel,
.viz-section .layer-controls {
    position: relative;
    z-index: 10;
}

.viz-section .depth-controls,
.viz-section .moon-anomalies,
.viz-section .bloodline-stats,
.viz-section .genetics-controls,
.viz-section .genetics-info,
.viz-section .codex-controls,
.viz-section .codex-info {
    position: relative;
    z-index: 10;
}

/* Fix absolute positioned info panels - ensure they don't overflow */
#earth-info-panel,
#codex-info-panel,
#codex-earth-panel,
.matrix-details-panel {
    z-index: 100;
    max-width: calc(100% - 40px);
    overflow-y: auto;
    max-height: 80vh;
}

/* Mobile overflow fixes */
@media (max-width: 768px) {
    #visualization-container {
        padding: 10px;
        overflow-x: hidden;
    }

    .viz-section {
        overflow-x: hidden;
    }

    #world-map-container,
    #spiral-timeline-container,
    #earth-3d-container,
    #antarctica-layers,
    #moon-control-container,
    #bloodline-tree-container,
    #population-genetics-container,
    #universal-sound-generator,
    #evidence-container,
    #master-convergence-container,
    #convergence-3d,
    #codex-container,
    #live-tracker,
    #live-map {
        min-height: 400px;
    }

    #earth-info-panel,
    #codex-info-panel,
    #codex-earth-panel,
    .matrix-details-panel {
        position: fixed;
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 0;
        max-width: none;
        width: calc(100% - 20px);
        max-height: 50vh;
        border-radius: 12px 12px 0 0;
        transform: none;
    }
}

/* Ensure no horizontal overflow */
body {
    max-width: 100vw;
}

/* Fix for any absolutely positioned elements that might overflow */
.depth-controls,
.moon-anomalies,
.map-legend,
.zoom-controls {
    max-width: calc(100% - 40px);
}

/* Athenaeum theme overrides removed — now using magna-theme base styles */

/* ============================================
   CROSS-PLATFORM COMPATIBILITY FIXES
   Added by PlatformDebug system
   ============================================ */

/* No WebGL - hide 3D visualizations, show fallback */
body.no-webgl .viz-section canvas {
    display: none !important;
}

body.no-webgl .viz-section::after {
    content: 'WebGL is required for this visualization. Please use a modern browser.';
    display: block;
    padding: 40px;
    text-align: center;
    color: var(--warning-color);
    font-size: var(--fs-lg);
}

/* Reduced quality mode */
body.reduced-quality .cursor-magic,
body.reduced-quality .cursor-trail-canvas,
body.reduced-quality .cursor-dot {
    display: none !important;
}

body.reduced-quality .entrance-overlay {
    display: none !important;
}

body.reduced-quality .viz-section canvas {
    image-rendering: optimizeSpeed;
}

/* Safari compatibility */
body.safari-compat .viz-section {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

body.safari-compat canvas {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Safari on Windows - disable heavy effects */
body.safari-windows .cursor-magic,
body.safari-windows .cursor-trail-canvas,
body.safari-windows .cursor-dot,
body.safari-windows .cursor-ripple-container {
    display: none !important;
}

body.safari-windows .entrance-overlay {
    display: none !important;
}

body.safari-windows body::before {
    display: none !important;
}

/* ANGLE renderer compatibility (Windows Chrome) */
body.angle-renderer canvas {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* High DPI scaling fix */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .viz-section canvas {
        image-rendering: crisp-edges;
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Windows-specific fixes */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    /* IE11 fallback - hide complex animations */
    .cursor-magic,
    .cursor-trail-canvas,
    .entrance-overlay {
        display: none !important;
    }
}

/* Edge legacy fixes */
@supports (-ms-ime-align: auto) {
    .viz-section canvas {
        will-change: transform;
    }
}

/* Firefox-specific fixes */
@-moz-document url-prefix() {
    .viz-section canvas {
        image-rendering: optimizeSpeed;
    }
}

/* ============================================
   ENTRANCE OVERLAY FIX
   Force viewport dimensions to prevent expansion
   ============================================ */
#entrance-experience.entrance-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
}

#entrance-canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
}

.entrance-content {
    position: relative !important;
    z-index: 10 !important;
}

/* ============================================
   EMERALD INDEX HERO
   Minimal full-viewport entrance
   ============================================ */

.emerald-hero {
    position: fixed;
    inset: 0;
    background: #0a1210;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.8s ease-out;
}

.emerald-hero.hidden {
    opacity: 0;
    pointer-events: none;
}

.emerald-hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.emerald-title {
    font-family: var(--font-display, 'Cinzel', serif);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 300;
    letter-spacing: 0.15em;
    color: #e2e8f0;
    margin: 0;
    text-shadow: 0 0 60px rgba(13, 148, 136, 0.4);
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(20px);
    animation: emerald-title-in 1.2s ease-out 0.3s forwards;
}

@keyframes emerald-title-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.emerald-tagline {
    font-family: var(--font-heading, 'Cormorant Garamond', serif);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: #94a3b8;
    margin: 1.5rem 0 3rem;
    letter-spacing: 0.1em;
    font-style: italic;
    opacity: 0;
    transform: translateY(20px);
    animation: emerald-tagline-in 1s ease-out 0.8s forwards;
}

@keyframes emerald-tagline-in {
    to {
        opacity: 0.9;
        transform: translateY(0);
    }
}

.emerald-enter {
    background: transparent;
    border: 1px solid #0d9488;
    color: #14b8a6;
    padding: 1rem 3rem;
    font-family: var(--font-display, 'Cinzel', serif);
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: emerald-btn-in 0.8s ease-out 1.3s forwards;
}

@keyframes emerald-btn-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.emerald-enter:hover {
    background: rgba(13, 148, 136, 0.15);
    box-shadow: 0 0 30px rgba(13, 148, 136, 0.3);
}

.emerald-enter:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.5), 0 0 30px rgba(13, 148, 136, 0.3);
}

/* Subtle breathing glow behind title */
.emerald-hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(13, 148, 136, 0.15) 0%, transparent 70%);
    animation: emerald-breathe 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes emerald-breathe {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Body state when hero is active */
body.hero-active {
    overflow: hidden;
}

/* Skip link for returning users */
.emerald-skip {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    border: none;
    color: #64748b;
    font-family: var(--font-body, 'Libre Baskerville', serif);
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0;
    animation: emerald-skip-in 0.5s ease-out 2s forwards;
    transition: color 0.2s ease;
}

.emerald-skip:hover {
    color: #94a3b8;
}

@keyframes emerald-skip-in {
    to {
        opacity: 0.6;
    }
}

/* ============================================================
   Guardian Voice Agent - Floating FAB & Overlay
   ============================================================ */

/* --- FAB Button --- */
.guardian-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1500;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.6);
    background: linear-gradient(135deg, rgba(10, 10, 15, 0.92), rgba(30, 20, 50, 0.92));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffd700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.25), 0 0 40px rgba(138, 43, 226, 0.15);
    transition: all 0.3s ease;
}

.guardian-fab:hover {
    transform: scale(1.08);
    border-color: #ffd700;
    box-shadow: 0 4px 24px rgba(212, 175, 55, 0.4), 0 0 50px rgba(138, 43, 226, 0.25);
}

.guardian-fab.active {
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
}

.guardian-fab-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.guardian-fab-label {
    font-size: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    opacity: 0.85;
}

/* --- Overlay Panel --- */
.guardian-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 24px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.guardian-overlay.open {
    pointer-events: auto;
    opacity: 1;
}

.guardian-overlay-panel {
    width: 360px;
    max-height: calc(100vh - 48px);
    background: linear-gradient(180deg, rgba(10, 10, 18, 0.96) 0%, rgba(15, 12, 28, 0.96) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 60px rgba(138, 43, 226, 0.1);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.guardian-overlay.open .guardian-overlay-panel {
    transform: translateY(0) scale(1);
}

/* --- Header --- */
.guardian-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}

.guardian-overlay-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffd700;
    letter-spacing: 0.04em;
}

.guardian-overlay-close {
    background: none;
    border: none;
    color: rgba(244, 228, 188, 0.6);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.guardian-overlay-close:hover {
    color: #ffd700;
}

/* --- Body --- */
.guardian-overlay-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 18px 12px;
    gap: 12px;
    overflow: hidden;
}

/* --- Orb Visualizer --- */
.guardian-orb {
    width: 80px;
    height: 80px;
    position: relative;
    flex-shrink: 0;
}

.guardian-orb-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.3);
    transition: all 0.4s ease;
}

.guardian-orb-core {
    position: absolute;
    inset: 16px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.4), rgba(138, 43, 226, 0.2));
    transition: all 0.4s ease;
}

/* Orb states */
.guardian-orb--listening .guardian-orb-ring {
    border-color: rgba(0, 200, 255, 0.6);
    animation: guardian-pulse-ring 2s ease-in-out infinite;
}

.guardian-orb--listening .guardian-orb-core {
    background: radial-gradient(circle, rgba(0, 200, 255, 0.5), rgba(0, 100, 200, 0.2));
    animation: guardian-pulse-core 2s ease-in-out infinite;
}

.guardian-orb--speaking .guardian-orb-ring {
    border-color: rgba(212, 175, 55, 0.8);
    animation: guardian-speak-ring 0.6s ease-in-out infinite;
}

.guardian-orb--speaking .guardian-orb-core {
    background: radial-gradient(circle, rgba(255, 215, 0, 0.6), rgba(212, 175, 55, 0.3));
    animation: guardian-speak-core 0.6s ease-in-out infinite;
}

.guardian-orb--thinking .guardian-orb-ring {
    border-color: rgba(138, 43, 226, 0.6);
    animation: guardian-think-ring 1.2s linear infinite;
}

.guardian-orb--thinking .guardian-orb-core {
    background: radial-gradient(circle, rgba(138, 43, 226, 0.4), rgba(80, 20, 140, 0.2));
    animation: guardian-pulse-core 1.2s ease-in-out infinite;
}

@keyframes guardian-pulse-ring {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.08); opacity: 1; }
}

@keyframes guardian-pulse-core {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes guardian-speak-ring {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes guardian-speak-core {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    25% { transform: scale(1.2); opacity: 1; }
    75% { transform: scale(0.95); opacity: 0.7; }
}

@keyframes guardian-think-ring {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Status --- */
.guardian-status {
    font-size: 0.78rem;
    color: rgba(244, 228, 188, 0.6);
    text-align: center;
    letter-spacing: 0.03em;
}

/* --- Transcript --- */
.guardian-transcript {
    width: 100%;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.2) transparent;
}

.guardian-transcript::-webkit-scrollbar {
    width: 4px;
}

.guardian-transcript::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.25);
    border-radius: 2px;
}

.guardian-turn {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.guardian-turn--agent {
    border-left: 2px solid rgba(212, 175, 55, 0.5);
}

.guardian-turn--user {
    border-left: 2px solid rgba(0, 200, 255, 0.5);
}

.guardian-turn-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: rgba(244, 228, 188, 0.5);
}

.guardian-turn--agent .guardian-turn-label {
    color: rgba(212, 175, 55, 0.7);
}

.guardian-turn-text {
    font-size: 0.8rem;
    color: rgba(244, 228, 188, 0.85);
    line-height: 1.4;
}

/* --- Footer / Buttons --- */
.guardian-overlay-footer {
    padding: 12px 18px 16px;
    display: flex;
    gap: 8px;
    border-top: 1px solid rgba(212, 175, 55, 0.1);
}

.guardian-connect-btn,
.guardian-end-btn {
    flex: 1;
    padding: 10px 0;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.04em;
}

.guardian-connect-btn {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(138, 43, 226, 0.2));
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #ffd700;
}

.guardian-connect-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.4), rgba(138, 43, 226, 0.3));
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.guardian-connect-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.guardian-end-btn {
    background: rgba(200, 50, 50, 0.15);
    border: 1px solid rgba(200, 50, 50, 0.4);
    color: #e06060;
}

.guardian-end-btn:hover {
    background: rgba(200, 50, 50, 0.25);
    box-shadow: 0 0 15px rgba(200, 50, 50, 0.2);
}

/* --- Mobile --- */
@media (max-width: 768px) {
    .guardian-fab {
        width: 48px;
        height: 48px;
        bottom: 16px;
        right: 16px;
    }

    .guardian-fab-label {
        display: none;
    }

    .guardian-fab-icon {
        font-size: 1.3rem;
    }

    .guardian-overlay {
        padding: 0;
    }

    .guardian-overlay-panel {
        width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        border: none;
    }

    .guardian-transcript {
        max-height: calc(100vh - 320px);
    }
}

/* ═══════════════════════════════════════════════════════════════════
   FREQUENCIES TAB — Sub-Navigation & Panels
   ═══════════════════════════════════════════════════════════════════ */

.freq-sub-nav {
    display: flex;
    gap: 0;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 0;
}

.freq-sub-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #5c6773;
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.freq-sub-btn:hover {
    color: #8994a3;
}

.freq-sub-btn.active {
    color: #e8ecf0;
    border-bottom-color: #6c9bce;
}

.freq-panel {
    display: none;
    min-height: 400px;
    padding-top: 4px;
}

.freq-panel.active {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════
   SUBSCRIPTION GATE — Upgrade Modal & Gating Overlay
   ═══════════════════════════════════════════════════════════════════ */

.sub-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.sub-gate-overlay.visible {
    opacity: 1;
}

.sub-gate-modal {
    background: linear-gradient(145deg, #0e101c, #141728);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 16px;
    padding: 40px 36px;
    max-width: 820px;
    width: 100%;
    position: relative;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(168, 85, 247, 0.08);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s ease;
}

.sub-gate-overlay.visible .sub-gate-modal {
    transform: scale(1) translateY(0);
}

.sub-gate-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sub-gate-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sub-gate-lock {
    text-align: center;
    margin-bottom: 16px;
    color: rgba(168, 85, 247, 0.6);
}

.sub-gate-title {
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    color: #e8e5de;
    margin-bottom: 8px;
}

.sub-gate-desc {
    text-align: center;
    color: rgba(200, 195, 180, 0.6);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 32px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.sub-gate-desc strong {
    color: #e879f9;
}

.sub-gate-tiers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.sub-gate-tier {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 24px 20px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.sub-gate-tier:hover {
    border-color: rgba(168, 85, 247, 0.3);
    background: rgba(168, 85, 247, 0.04);
}

.sub-gate-tier.featured {
    border-color: rgba(168, 85, 247, 0.35);
    background: rgba(168, 85, 247, 0.06);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.06);
}

.sub-gate-tier-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #a855f7, #e879f9);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 3px 12px;
    border-radius: 10px;
}

.sub-gate-tier-name {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    color: #e8e5de;
    margin-bottom: 8px;
    font-weight: 600;
}

.sub-gate-tier-price {
    font-size: 2rem;
    font-weight: 700;
    color: #ffd700;
    margin-bottom: 16px;
}

.sub-gate-tier-price span {
    font-size: 0.9rem;
    font-weight: 400;
    color: rgba(200, 195, 180, 0.5);
}

.sub-gate-tier-features {
    list-style: none;
    text-align: left;
    margin-bottom: 20px;
    padding: 0;
}

.sub-gate-tier-features li {
    padding: 4px 0;
    color: rgba(200, 195, 180, 0.7);
    font-size: 0.85rem;
    position: relative;
    padding-left: 18px;
}

.sub-gate-tier-features li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: #a855f7;
    font-weight: 700;
}

.sub-gate-tier-btn {
    width: 100%;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 6px;
    color: #e879f9;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sub-gate-tier-btn:hover {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.5);
}

.sub-gate-tier-btn.primary {
    background: linear-gradient(135deg, #a855f7, #e879f9);
    color: #fff;
    border-color: transparent;
}

.sub-gate-tier-btn.primary:hover {
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .sub-gate-tiers {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .sub-gate-modal {
        padding: 28px 20px;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   PROFILE BUTTON — Avatar Ring
   ═══════════════════════════════════════════════════════════════════ */

.profile-avatar-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(212, 175, 55, 0.2));
    border: 2px solid rgba(212, 175, 55, 0.3);
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    letter-spacing: 0.02em;
}

.profile-avatar-btn:hover {
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.15);
    transform: scale(1.05);
}

.profile-avatar-btn::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1px solid rgba(168, 85, 247, 0.2);
    animation: profile-ring-pulse 3s ease-in-out infinite;
}

@keyframes profile-ring-pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.08); }
}

.profile-avatar-tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(14, 16, 28, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 0.65rem;
    color: rgba(200, 195, 180, 0.8);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
}

.profile-avatar-btn:hover .profile-avatar-tooltip {
    opacity: 1;
}

/* ============================================
   IRONWORK DECORATIVE ELEMENTS
   From D.D. Badger Architectural Iron Works, 1865
   ============================================ */

/* Ornamental ironwork divider strip */
.ironwork-divider {
    width: 100%;
    height: 14px;
    margin: 12px 0;
    background-image: url('../images/ironwork/gate-rail-ornate-strip.png');
    background-size: auto 14px;
    background-repeat: repeat-x;
    background-position: center;
    filter: invert(1) brightness(0.30) sepia(0.3) hue-rotate(10deg);
    opacity: 0.14;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 12%, black 88%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, black 12%, black 88%, transparent 100%);
}

.ironwork-divider--cornice {
    background-image: url('../images/ironwork/cornice-rule-strip.png');
    height: 12px;
    background-size: auto 12px;
    opacity: 0.15;
}

.ironwork-divider--heavy {
    background-image: url('../images/ironwork/balustrade-rail-heavy-strip.png');
    height: 10px;
    background-size: auto 10px;
    opacity: 0.12;
}

/* Featured section heading with ironwork accent */
.dashboard-featured h2 .ironwork-accent {
    display: block;
    width: 100%;
    margin-top: 6px;
}

/* Frosted glass surface — shared utility */
.glass-surface {
    background: rgba(10, 16, 32, 0.55);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border: 1px solid rgba(180, 160, 120, 0.08);
}

/* Card warm glow on hover */
.featured-card:hover,
.viz-card:hover,
.insight-card:hover {
    border-color: rgba(180, 160, 120, 0.18);
}

/* Section breathing room */
.magna-theme .viz-section#overview {
    padding-top: 24px;
    padding-bottom: 48px;
}


/* ════════════════════════════════════════════════════════════════
   SACRED GEOMETRY DASHBOARD REDESIGN
   Chamfered octagons, diamond facets, hexagonal nodes, arched
   scrolls, golden ratio grids, and geometric decorations.
   The pattern was always there — now the UI embodies it.
   ════════════════════════════════════════════════════════════════ */

/* --- KEYFRAME ANIMATIONS --- */

@keyframes orbital-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes hexagon-breathe {
    0%, 100% { opacity: 0.06; }
    50%      { opacity: 0.16; }
}

@keyframes metric-fade-in {
    from { opacity: 0; transform: scale(0.8); }
    to   { opacity: 1; transform: scale(1); }
}


/* ─── FEATURED CARDS: CHAMFERED OCTAGON ─── */

.featured-card {
    clip-path: polygon(
        14px 0, calc(100% - 14px) 0,
        100% 14px, 100% calc(100% - 14px),
        calc(100% - 14px) 100%, 14px 100%,
        0 calc(100% - 14px), 0 14px
    );
    border-radius: 0;
    border: none;
    overflow: visible;
    box-shadow: none;
    filter: drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.55))
            drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.55))
            drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.55))
            drop-shadow(0 0 0px transparent)
            drop-shadow(0 4px 20px rgba(0, 0, 0, 0.6));
    --card-accent-glow: rgba(180, 140, 40, 0.15);
}

.featured-card:hover {
    box-shadow: none;
    filter: drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.7))
            drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.7))
            drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.7))
            drop-shadow(0 0 12px var(--card-accent-glow))
            drop-shadow(0 8px 30px rgba(0, 0, 0, 0.65));
}

/* Flower of Life overlay — removed, too intrusive over card content */

/* Per-card accent glow colors */
.featured-card[data-launch="grid-globe"],
a.featured-card[href*="global-grid"] { --card-accent-glow: rgba(212, 175, 55, 0.25); }
.featured-card[data-launch="codex"]   { --card-accent-glow: rgba(139, 92, 246, 0.25); }
.featured-card[data-launch="gateway-process"] { --card-accent-glow: rgba(34, 211, 238, 0.25); }
.featured-card[data-launch="tech-map"] { --card-accent-glow: rgba(244, 63, 94, 0.25); }
.featured-card[data-launch="electromagnetic"] { --card-accent-glow: rgba(245, 158, 11, 0.25); }
.featured-card[data-launch="the-signal"] { --card-accent-glow: rgba(168, 85, 247, 0.28); }


/* ─── VIZ CARDS: DIAMOND-CUT FACET ─── */

.viz-card {
    clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
    border-radius: 0;
    border: none;
    border-left: none;
    overflow: visible;
    box-shadow: none;
    filter: drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.4))
            drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.4))
            drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.4))
            drop-shadow(0 0 0px transparent)
            drop-shadow(0 3px 12px rgba(0, 0, 0, 0.45));
    --viz-accent: rgba(255, 255, 255, 0.15);
}

.viz-card:hover {
    box-shadow: none;
    filter: drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.6))
            drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.6))
            drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.6))
            drop-shadow(0 0 10px var(--viz-accent))
            drop-shadow(0 6px 20px rgba(0, 0, 0, 0.55));
}

/* Corner glow at the diamond cut */
.viz-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(225deg, var(--viz-accent) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
    opacity: 0.85;
    transition: opacity 0.4s ease;
}

.viz-card:hover::before {
    opacity: 1;
}

/* Gem flash at diamond vertex */
.viz-card::after {
    content: '';
    position: absolute;
    top: -1px;
    right: 21px;
    width: 5px;
    height: 5px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(196, 163, 90, 0.3) 40%, transparent 100%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.4s ease;
}

.viz-card:hover::after {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.85) 0%, rgba(196, 163, 90, 0.5) 40%, transparent 100%);
}

/* Per-card accent variables for corner glow */
.viz-card[data-launch="timeline"]         { --viz-accent: rgba(244, 63, 94, 0.45); }
.viz-card[data-launch="electromagnetic"]  { --viz-accent: rgba(245, 158, 11, 0.45); }
.viz-card[data-launch="codex"]            { --viz-accent: rgba(139, 92, 246, 0.45); }
.viz-card[data-launch="gateway-process"]  { --viz-accent: rgba(34, 211, 238, 0.45); }
.viz-card[data-launch="grid-globe"],
.viz-card.grid-globe-card                 { --viz-accent: rgba(212, 175, 55, 0.45); }
.viz-card[data-launch="tech-map"]         { --viz-accent: rgba(244, 63, 94, 0.35); }
.viz-card[data-launch="node-network"]     { --viz-accent: rgba(16, 185, 129, 0.35); }


/* ─── READING CARDS: ARCHED SCROLLS ─── */

.reading-card {
    border-radius: 24px 24px 6px 6px;
    border: 1px solid rgba(196, 163, 90, 0.12);
    border-top: 2px solid var(--accent, rgba(196, 163, 90, 0.35));
    filter: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.reading-card:hover {
    border-color: rgba(196, 163, 90, 0.2);
    border-top-color: var(--accent, #c4a35a);
    box-shadow: 0 0 20px color-mix(in srgb, var(--accent, #c4a35a) 10%, transparent),
                0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Vesica Piscis ornament at arch apex */
.reading-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 28px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 28'%3E%3Ccircle cx='18' cy='14' r='11' fill='none' stroke='%23c4a35a' stroke-width='1.0' opacity='0.85'/%3E%3Ccircle cx='30' cy='14' r='11' fill='none' stroke='%23c4a35a' stroke-width='1.0' opacity='0.85'/%3E%3C/svg%3E") center / contain no-repeat;
    opacity: 0.65;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.reading-card:hover::before {
    opacity: 1;
}


/* ─── INSIGHT CARDS: HEXAGONAL NODES ─── */

.insight-card {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border-radius: 0;
    border: none;
    box-shadow: none;
    filter: drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.45))
            drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.45))
            drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.45))
            drop-shadow(0 0 0px transparent)
            drop-shadow(0 4px 16px rgba(0, 0, 0, 0.45));
    aspect-ratio: 1.155;
    padding: 22% 16% 18%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    --insight-glow: rgba(244, 63, 94, 0.12);
}

.insight-card:hover {
    box-shadow: none;
    filter: drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.65))
            drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.65))
            drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.65))
            drop-shadow(0 0 14px var(--insight-glow))
            drop-shadow(0 8px 24px rgba(0, 0, 0, 0.55));
}

/* Per-card glow colors */
.insight-card:nth-child(1) { --insight-glow: rgba(244, 63, 94, 0.16); }
.insight-card:nth-child(2) { --insight-glow: rgba(245, 158, 11, 0.16); }
.insight-card:nth-child(3) { --insight-glow: rgba(34, 211, 238, 0.16); }

/* Radial glow replaces bottom gradient line */
.insight-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 40%, var(--insight-glow), transparent 70%);
    clip-path: inherit;
    pointer-events: none;
    z-index: 0;
    animation: hexagon-breathe 6s ease-in-out infinite;
}

/* Staggered breathing delays */
.insight-card:nth-child(1)::after { animation-delay: 0s; }
.insight-card:nth-child(2)::after { animation-delay: 2s; }
.insight-card:nth-child(3)::after { animation-delay: 4s; }

/* Adjust number sizing for hexagonal frame */
.insight-card .insight-number {
    font-size: 2.4rem;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.insight-card .insight-text {
    position: relative;
    z-index: 1;
    font-size: 0.82rem;
    line-height: 1.45;
}


/* ─── GOLDEN RATIO FEATURED GRID ─── */

.dashboard-featured .featured-grid {
    grid-template-columns: 1.618fr 1fr;
    grid-template-rows: repeat(3, auto);
    gap: 20px;
}

.dashboard-featured .featured-card:first-child {
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
}

.dashboard-featured .featured-card:first-child .featured-preview {
    flex: 1;
    height: auto;
    min-height: 260px;
}


/* ─── STAGGERED VIZ GRID ─── */

.viz-grid .viz-card:nth-child(even) {
    transform: translateY(12px);
}

.viz-grid .viz-card:nth-child(even):hover {
    transform: translateY(12px) translateX(4px);
}


/* ─── TRIANGLE INSIGHTS ARRANGEMENT ─── */

.dashboard-insights .insights-grid {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 24px;
    padding: 20px 0 40px;
}

.dashboard-insights .insights-grid .insight-card {
    width: 240px;
    min-width: 200px;
    flex-shrink: 0;
}

.dashboard-insights .insights-grid .insight-card:nth-child(1) {
    transform: translateY(-20px);
}

.dashboard-insights .insights-grid .insight-card:nth-child(2),
.dashboard-insights .insights-grid .insight-card:nth-child(3) {
    transform: translateY(28px);
}


/* ─── SECTION DIVIDERS: SEED OF LIFE ─── */

.dashboard-featured h2,
.dashboard-grid h2,
.dashboard-reading h2,
.dashboard-insights h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.dashboard-featured h2::before,
.dashboard-featured h2::after,
.dashboard-grid h2::before,
.dashboard-grid h2::after,
.dashboard-reading h2::before,
.dashboard-reading h2::after,
.dashboard-insights h2::before,
.dashboard-insights h2::after {
    content: '';
    flex: 1;
    max-width: 200px;
    height: 32px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='8' fill='none' stroke='%23c4a35a' stroke-width='0.6' opacity='0.7'/%3E%3Ccircle cx='20' cy='12' r='8' fill='none' stroke='%23c4a35a' stroke-width='0.6' opacity='0.7'/%3E%3Ccircle cx='20' cy='28' r='8' fill='none' stroke='%23c4a35a' stroke-width='0.6' opacity='0.7'/%3E%3Ccircle cx='13.07' cy='16' r='8' fill='none' stroke='%23c4a35a' stroke-width='0.6' opacity='0.7'/%3E%3Ccircle cx='26.93' cy='16' r='8' fill='none' stroke='%23c4a35a' stroke-width='0.6' opacity='0.7'/%3E%3Ccircle cx='13.07' cy='24' r='8' fill='none' stroke='%23c4a35a' stroke-width='0.6' opacity='0.7'/%3E%3Ccircle cx='26.93' cy='24' r='8' fill='none' stroke='%23c4a35a' stroke-width='0.6' opacity='0.7'/%3E%3C/svg%3E") center / 32px repeat-x;
    opacity: 0.5;
    -webkit-mask-image: linear-gradient(to right, transparent, white 20%, white 80%, transparent);
    mask-image: linear-gradient(to right, transparent, white 20%, white 80%, transparent);
}


/* ─── ROTATING METATRON BACKGROUND — REMOVED ─── */
/* Killed entirely: 900px CSS-animated SVG eating GPU for 4% opacity decoration */


/* ─── RESEARCH METRICS: ALCHEMICAL FRAMES ─── */

.research-metrics {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    padding: 32px 16px;
    border: none;
    background: none;
}

.research-metrics .metric {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0;
    gap: 8px;
}

.research-metrics .metric-num {
    position: relative;
    font-size: 1.6rem;
    z-index: 1;
    animation: metric-fade-in 1s ease-out both;
}

.research-metrics .metric:nth-child(1) .metric-num { animation-delay: 0.1s; }
.research-metrics .metric:nth-child(3) .metric-num { animation-delay: 0.25s; }
.research-metrics .metric:nth-child(5) .metric-num { animation-delay: 0.4s; }
.research-metrics .metric:nth-child(7) .metric-num { animation-delay: 0.55s; }

/* Metrics — clean, no decorations. Numbers speak for themselves. */
.research-metrics .metric-num::before,
.research-metrics .metric-num::after {
    display: none;
}

/* Hide separators — orbital frames replace them */
.research-metrics .metric-sep {
    display: none;
}

.research-metrics .metric-label {
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    opacity: 0.6;
}


/* ═══════════════════════════════════════════════
   SACRED GEOMETRY — MOBILE FALLBACKS
   ═══════════════════════════════════════════════ */

@media (max-width: 1024px) {
    /* Relax golden ratio to equal columns */
    .dashboard-featured .featured-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }
    .dashboard-featured .featured-card:first-child {
        grid-row: auto;
    }
    .dashboard-featured .featured-card:first-child .featured-preview {
        height: 160px;
        min-height: auto;
        flex: none;
    }
}

@media (max-width: 768px) {
    /* Featured: reduce chamfer */
    .featured-card {
        clip-path: polygon(
            10px 0, calc(100% - 10px) 0,
            100% 10px, 100% calc(100% - 10px),
            calc(100% - 10px) 100%, 10px 100%,
            0 calc(100% - 10px), 0 10px
        );
    }

    /* Viz: reduce diamond cut */
    .viz-card {
        clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
    }
    .viz-card::before {
        width: 28px;
        height: 28px;
    }

    /* Insights: stack vertically, no hexagons on small screens */
    .insight-card {
        clip-path: none;
        border-radius: 12px;
        aspect-ratio: auto;
        padding: 28px 20px;
    }
    .insight-card::after {
        clip-path: none;
        border-radius: 12px;
    }

    .dashboard-insights .insights-grid {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    .dashboard-insights .insights-grid .insight-card {
        width: 100%;
        max-width: 400px;
    }
    .dashboard-insights .insights-grid .insight-card:nth-child(1),
    .dashboard-insights .insights-grid .insight-card:nth-child(2),
    .dashboard-insights .insights-grid .insight-card:nth-child(3) {
        transform: none;
    }

    /* Golden ratio → single column */
    .dashboard-featured .featured-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .dashboard-featured .featured-card:first-child {
        grid-row: auto;
    }
    .dashboard-featured .featured-card:first-child .featured-preview {
        height: 160px;
        min-height: auto;
        flex: none;
    }

    /* Remove viz stagger on mobile */
    .viz-grid .viz-card:nth-child(even) {
        transform: none;
    }
    .viz-grid .viz-card:nth-child(even):hover {
        transform: translateX(4px);
    }

    /* Section dividers — smaller */
    .dashboard-featured h2::before,
    .dashboard-featured h2::after,
    .dashboard-grid h2::before,
    .dashboard-grid h2::after,
    .dashboard-reading h2::before,
    .dashboard-reading h2::after,
    .dashboard-insights h2::before,
    .dashboard-insights h2::after {
        max-width: 50px;
        height: 18px;
        background-size: 18px;
    }

    /* Reading cards: reduce arch */
    .reading-card {
        border-radius: 16px 16px 6px 6px;
    }

    /* Reduce stacked shadows on mobile for performance */
    .featured-card {
        filter: drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.55))
                drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.55))
                drop-shadow(0 4px 16px rgba(0, 0, 0, 0.5));
    }
    .viz-card {
        filter: drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.4))
                drop-shadow(0 0 0.5px rgba(196, 163, 90, 0.4))
                drop-shadow(0 3px 10px rgba(0, 0, 0, 0.4));
    }
    .viz-card::after {
        display: none;
    }

    /* Metrics: tighter on mobile */
    .research-metrics {
        gap: 20px;
        padding: 20px 8px;
    }
    /* Metric pseudo-elements removed — no mobile sizing needed */

}

@media (max-width: 480px) {
    /* Featured: minimal chamfer */
    .featured-card {
        clip-path: polygon(
            6px 0, calc(100% - 6px) 0,
            100% 6px, 100% calc(100% - 6px),
            calc(100% - 6px) 100%, 6px 100%,
            0 calc(100% - 6px), 0 6px
        );
    }

    /* Viz: minimal diamond */
    .viz-card {
        clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
    }
    .viz-card::before {
        width: 20px;
        height: 20px;
    }

    /* Section dividers: hide on very small screens */
    .dashboard-featured h2::before,
    .dashboard-featured h2::after,
    .dashboard-grid h2::before,
    .dashboard-grid h2::after,
    .dashboard-reading h2::before,
    .dashboard-reading h2::after,
    .dashboard-insights h2::before,
    .dashboard-insights h2::after {
        display: none;
    }

    /* Metrics: compact */
    .research-metrics {
        gap: 12px;
    }
    .research-metrics .metric-num {
        font-size: 1.2rem;
    }
    /* Metric pseudo-elements removed — no mobile sizing needed */

}
