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

/* ==================== THEME VARIABLES ==================== */
:root {
    /* Shared */
    --nav-height: 64px;
    --font-display: 'Oswald', 'Arial Narrow', sans-serif;
    --font-body: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-mono: 'Fira Mono', 'Courier New', monospace;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- DARK THEME (default) ---------- */
[data-theme="dark"] {
    --bg-primary: #0D0B08;
    --bg-secondary: #161210;
    --bg-card: #1E1914;
    --bg-card-hover: #28221A;
    --bg-input: #1A1510;
    --text-primary: #E8DFD0;
    --text-secondary: #A09080;
    --text-muted: #8A7C6C;
    --accent: #D4901E;
    --accent-hover: #E8A030;
    --accent-glow: rgba(212, 144, 30, 0.25);
    --rust: #B04030;
    --rust-light: rgba(176, 64, 48, 0.15);
    --prairie-green: #5D8C3E;
    --prairie-green-light: rgba(93, 140, 62, 0.12);
    --sky-blue: #5A9DB8;
    --sky-blue-light: rgba(90, 157, 184, 0.12);
    --border: #2A2420;
    --border-light: #3A3430;
    --pipeline-fill: #3A3020;
    --pipeline-inner: #2A2018;
    --shadow: rgba(0, 0, 0, 0.4);
    --hero-sky-top: #1A1408;
    --hero-sky-mid: #2A1A0A;
    --hero-sky-bot: #0D0B08;
    --silhouette: #0D0B08;
    --ground: #1A1410;
    --overlay: rgba(13, 11, 8, 0.6);
    color-scheme: dark;
}

/* ---------- LIGHT THEME ---------- */
[data-theme="light"] {
    --bg-primary: #F5F0E8;
    --bg-secondary: #EDE6DA;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FBF8F2;
    --bg-input: #FFFFFF;
    --text-primary: #1A1410;
    --text-secondary: #5A4A3A;
    --text-muted: #6A5C4E;
    --accent: #B07010;
    --accent-hover: #C88018;
    --accent-glow: rgba(176, 112, 16, 0.2);
    --rust: #902820;
    --rust-light: rgba(144, 40, 32, 0.1);
    --prairie-green: #4A7030;
    --prairie-green-light: rgba(74, 112, 48, 0.1);
    --sky-blue: #3A7D98;
    --sky-blue-light: rgba(58, 125, 152, 0.1);
    --border: #D8D0C0;
    --border-light: #C8C0B0;
    --pipeline-fill: #C0B8A0;
    --pipeline-inner: #D8D0C0;
    --shadow: rgba(0, 0, 0, 0.1);
    --hero-sky-top: #C8A060;
    --hero-sky-mid: #E0C890;
    --hero-sky-bot: #F5F0E8;
    --silhouette: #3A3020;
    --ground: #EDE6DA;
    --overlay: rgba(245, 240, 232, 0.5);
    color-scheme: light;
}

/* ==================== BASE ==================== */
html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-padding-top: var(--nav-height);
    /* Safari: prevent elastic overscroll from revealing bg */
    overscroll-behavior-y: none;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Safari safe area */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    transition: background var(--transition), color var(--transition);
}

::selection {
    background: var(--accent-glow);
    color: var(--text-primary);
}

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

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ==================== NAVIGATION ==================== */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-primary);
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    transition: background var(--transition), border-color var(--transition);
    /* Safari: avoid backdrop-filter jank, use solid bg instead */
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
    flex-shrink: 0;
}

.nav-derrick {
    color: var(--accent);
}

.nav-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-primary);
    transition: color var(--transition);
}

.nav-links {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-link {
    font-family: var(--font-display);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 6px 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color var(--transition), background var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border-light);
    flex-shrink: 0;
}

.nav-link-contact {
    font-family: var(--font-display);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 6px 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color var(--transition), background var(--transition);
}

.nav-link-contact:hover,
.nav-link-contact.active {
    color: var(--accent);
}

.nav-link-contact-mobile {
    display: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.currency-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    height: 36px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 0;
}
.currency-toggle:hover {
    border-color: var(--accent);
}
.currency-option {
    color: var(--text-muted);
    transition: color 0.2s ease;
    padding: 2px 3px;
}
.currency-option.currency-active {
    color: var(--accent);
}
.currency-slash {
    color: var(--border);
    font-weight: 400;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun { display: none; }

.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
}

.nav-hamburger span {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition);
}

.nav-hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
}
.nav-hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 1024px) {
    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 2px solid var(--border);
        flex-direction: column;
        padding: 12px 24px;
        gap: 0;
    }
    .nav-links.open {
        display: flex;
    }
    .nav-link {
        padding: 10px 0;
        border-bottom: 1px solid var(--border);
    }
    .nav-link.active {
        border-bottom-color: var(--accent);
    }
    .nav-divider,
    .nav-link-contact {
        display: none;
    }
    .nav-link-contact-mobile {
        display: block !important;
    }
    .nav-hamburger {
        display: flex;
    }
}

/* ==================== SECTIONS ==================== */
.section {
    padding: 100px 0;
    min-height: 100vh;
    position: relative;
    transition: background var(--transition);
}

.section-alt {
    background: var(--bg-secondary);
}

.section-header {
    text-align: center;
    margin-bottom: 56px;
}

.section-number {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.12em;
    display: block;
    margin-bottom: 12px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 16px;
    transition: color var(--transition);
}

.section-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
    font-style: italic;
}

.section-cite {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 8px;
    font-style: normal;
}

/* ==================== HERO ==================== */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-top: var(--nav-height);
    position: relative;
    overflow: hidden;
}

.hero-parallax-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.parallax-layer {
    position: absolute;
    inset: 0;
    will-change: transform;
    /* Safari: use translate3d for GPU acceleration */
    transform: translate3d(0, 0, 0);
}

.parallax-sky {
    background: linear-gradient(
        180deg,
        var(--hero-sky-top) 0%,
        var(--hero-sky-mid) 40%,
        var(--hero-sky-bot) 100%
    );
    transition: background var(--transition-slow);
}

.parallax-horizon {
    top: auto;
    bottom: 0;
    height: 35%;
    display: flex;
    align-items: flex-end;
}

.prairie-silhouette {
    width: 100%;
    height: 100%;
    color: var(--silhouette);
    transition: color var(--transition-slow);
}

.parallax-ground {
    top: auto;
    bottom: 0;
    height: 5%;
    background: var(--ground);
    transition: background var(--transition-slow);
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 0 24px;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.hero-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid var(--accent);
    padding: 8px 20px;
    margin-bottom: 28px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 10vw, 8rem);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 28px;
}

.hero-line {
    display: block;
}

.hero-accent {
    color: var(--accent);
    text-shadow: 0 0 60px var(--accent-glow);
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 660px;
    margin: 0 auto 20px;
    line-height: 1.7;
}

.hero-researcher {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.hero-researcher strong {
    color: var(--text-primary);
}

.hero-stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.hero-stat-value {
    font-family: var(--font-mono);
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--accent);
    display: block;
}

.hero-stat-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-stat-divider {
    width: 2px;
    height: 40px;
    background: var(--border);
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bg-primary);
    background: var(--accent);
    padding: 14px 32px;
    transition: all var(--transition);
}

.hero-cta:hover {
    background: var(--accent-hover);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.hero-cta svg {
    animation: bounceDown 2s infinite;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

.scroll-indicator {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    z-index: 2;
}

.scroll-line {
    width: 2px;
    height: 40px;
    background: var(--text-muted);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 50%;
    background: var(--accent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0% { top: -50%; }
    100% { top: 150%; }
}

.scroll-indicator span {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* ==================== PIPELINE DIVIDER ==================== */
.pipeline-divider {
    height: 40px;
    background: var(--bg-primary);
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition: background var(--transition);
}

.pipeline-divider svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ==================== DASHBOARD ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2px;
    margin-bottom: 48px;
    background: var(--border);
}

.dash-card {
    background: var(--bg-card);
    padding: 28px;
    transition: all var(--transition);
    position: relative;
}

.dash-card-stripe {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    opacity: 0;
    transition: opacity var(--transition);
}

.dash-card:hover {
    background: var(--bg-card-hover);
}

.dash-card:hover .dash-card-stripe {
    opacity: 1;
}

.dash-card-featured {
    grid-column: span 2;
}

@media (max-width: 640px) {
    .dash-card-featured {
        grid-column: span 1;
    }
}

.dash-card-icon {
    color: var(--accent);
    margin-bottom: 12px;
}

.dash-card-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.dash-card-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.dash-card-source {
    display: block;
    margin-top: 12px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ==================== VIZ PANELS ==================== */
.viz-panel {
    background: var(--bg-card);
    border: 2px solid var(--border);
    padding: 36px;
    margin-top: 40px;
    transition: all var(--transition);
}

.viz-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.viz-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

/* ==================== ROYALTY BARS ==================== */
.royalty-bars {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.royalty-group h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
    color: var(--text-primary);
}

.bar-pair {
    margin-bottom: 10px;
}

.bar-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.bar-track {
    height: 32px;
    background: var(--border);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 12px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    width: 0;
    transition: width 1.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-fill.animated {
    width: var(--bar-width);
}

.bar-target {
    background: var(--sky-blue);
}

.bar-actual {
    background: var(--accent);
}

.bar-danger {
    background: var(--rust);
}

.bar-gap-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--rust);
    font-weight: 600;
    margin-top: 6px;
}

/* ==================== SANKEY / FLOWS ==================== */
.sankey-container {
    background: var(--bg-card);
    border: 2px solid var(--border);
    margin-bottom: 36px;
    overflow: hidden;
    position: relative;
    transition: all var(--transition);
}

#sankey-canvas {
    width: 100%;
    height: 420px;
    display: block;
}

.sankey-tooltip {
    position: absolute;
    background: var(--bg-primary);
    border: 1px solid var(--accent);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 8px 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
    max-width: 250px;
}

.sankey-tooltip.visible {
    opacity: 1;
}

.flow-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2px;
    background: var(--border);
}

.flow-card {
    background: var(--bg-card);
    padding: 24px;
    text-align: center;
    transition: all var(--transition);
}

.flow-card:hover {
    background: var(--bg-card-hover);
}

.flow-card-accent {
    border-left: 4px solid var(--accent);
}

.flow-amount {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--sky-blue);
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.flow-card-accent .flow-amount {
    color: var(--accent);
}

.flow-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.flow-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==================== TIMELINE ==================== */
.timeline-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 40px;
}

.timeline-era {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 8px 18px;
    border: 2px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.timeline-era:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.timeline-era.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
}

.timeline-wrapper {
    position: relative;
    padding-left: 40px;
}

.timeline-pipe {
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    width: 8px;
    background: var(--border);
}

.timeline-pipe::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--pipeline-fill);
}

.timeline-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.timeline-item {
    position: relative;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: none;
    transition: all var(--transition);
    opacity: 0;
    transform: translateX(20px);
}

.timeline-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -34px;
    top: 24px;
    width: 16px;
    height: 16px;
    background: var(--accent);
    z-index: 1;
    /* Diamond shape */
    transform: rotate(45deg);
    transition: background var(--transition);
}

.timeline-item:hover {
    background: var(--bg-card-hover);
}

.timeline-item:hover::before {
    background: var(--accent-hover);
    box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.timeline-item h4 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.timeline-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.timeline-era-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 2px 8px;
    margin-top: 8px;
}

.era-origins { background: var(--sky-blue-light); color: var(--sky-blue); }
.era-capture { background: var(--accent-glow); color: var(--accent); }
.era-deregulation { background: var(--rust-light); color: var(--rust); }
.era-crisis { background: var(--rust-light); color: var(--rust); }

/* Era-colored left accent on timeline items */
.timeline-item-origins { border-left: 3px solid var(--sky-blue); }
.timeline-item-capture { border-left: 3px solid var(--accent); }
.timeline-item-deregulation { border-left: 3px solid var(--rust); }
.timeline-item-crisis { border-left: 3px solid var(--rust); }

/* Timeline thumbnails */
.timeline-item-has-thumb {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.timeline-item-body {
    flex: 1;
    min-width: 0;
}

.timeline-thumb {
    flex-shrink: 0;
    width: 72px;
    opacity: 0.85;
    transition: opacity var(--transition), transform var(--transition);
}

.timeline-item:hover .timeline-thumb {
    opacity: 1;
    transform: scale(1.05);
}

.timeline-thumb-svg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}

@media (max-width: 480px) {
    .timeline-thumb {
        width: 56px;
    }
    .timeline-item-has-thumb {
        gap: 12px;
    }
}

/* ==================== LIABILITY ==================== */
.liability-visual {
    margin-bottom: 48px;
}

.liability-scale {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.liability-side {
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.liability-side h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}

.barrel-meter {
    width: 100%;
    max-width: 200px;
    height: 200px;
    margin: 0 auto;
    background: var(--border);
    position: relative;
    overflow: hidden;
    border: 2px solid var(--border-light);
}

.barrel-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transition: height 2s cubic-bezier(0.4, 0, 0.2, 1);
    height: 0;
}

.barrel-fill-assets {
    background: linear-gradient(0deg, var(--sky-blue), transparent);
}

.barrel-fill-danger {
    background: linear-gradient(0deg, var(--rust), rgba(176, 64, 48, 0.3));
}

.barrel-label {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    z-index: 1;
    text-shadow: 0 1px 3px var(--shadow);
}

.liability-vs {
    flex-shrink: 0;
}

.liability-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.liability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2px;
    background: var(--border);
    margin-bottom: 40px;
}

.liability-card {
    background: var(--bg-card);
    padding: 28px;
    transition: all var(--transition);
}

.liability-card:hover {
    background: var(--bg-card-hover);
}

.liability-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.liability-card-header svg {
    color: var(--accent);
    flex-shrink: 0;
}

.liability-card-header h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.liability-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Well field visualization (Alberta shape canvas) */
.well-field-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

#well-field-canvas {
    max-width: 100%;
}

.well-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

.well-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.well-legend-swatch {
    width: 14px;
    height: 14px;
    display: inline-block;
}

/* ==================== COLLATERAL ==================== */
.section-collateral {
    background: var(--bg-secondary);
}

.collateral-pipeline {
    max-width: 700px;
    margin: 0 auto 48px;
}

.pipeline-step {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 24px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    transition: all var(--transition);
}

.pipeline-step:hover {
    border-color: var(--accent);
}

.pipeline-marker {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
}

.pipeline-content h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    color: var(--accent);
}

.pipeline-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.pipeline-content blockquote {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--accent-glow);
    border-left: 4px solid var(--accent);
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.pipeline-content blockquote cite {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    font-style: normal;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.pipeline-connector {
    display: flex;
    justify-content: center;
    padding: 4px 0;
}

.pipeline-flow {
    width: 4px;
    height: 32px;
    background: var(--accent);
    position: relative;
    overflow: hidden;
}

.pipeline-flow::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 50%;
    background: var(--accent-hover);
    animation: flowDown 1.5s ease-in-out infinite;
}

@keyframes flowDown {
    0% { top: -50%; }
    100% { top: 150%; }
}

/* Barrel chart for borrowing */
.barrel-chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 28px;
    height: 280px;
    padding-top: 20px;
    margin-top: 20px;
}

.barrel-col {
    flex: 1;
    max-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.barrel-graphic {
    width: 100%;
    position: relative;
}

.barrel-body {
    width: 100%;
    background: var(--border);
    border: 2px solid var(--border-light);
    position: relative;
    overflow: hidden;
    min-height: 40px;
    transition: min-height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.barrel-crude {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(0deg, #1A1008, #3A2818);
    transition: height 2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .barrel-crude {
    background: linear-gradient(0deg, #2A1A0A, #5A4020);
}

.barrel-graphic-warn .barrel-crude {
    background: linear-gradient(0deg, #3A2008, var(--accent));
}

.barrel-graphic-danger .barrel-crude {
    background: linear-gradient(0deg, #3A1008, var(--rust));
}

.barrel-crude-overflow {
    box-shadow: 0 -4px 20px var(--rust);
}

.barrel-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-top: 6px;
}

.barrel-era {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 6px;
}

/* Core claim */
.core-claim {
    background: var(--accent-glow);
    border: 2px solid var(--accent);
    padding: 40px;
    text-align: center;
    margin-top: 48px;
    position: relative;
    animation: claimPulse 3s ease-in-out infinite;
}

@keyframes claimPulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
    50% { box-shadow: 0 0 30px 4px var(--accent-glow); }
}

.claim-icon {
    color: var(--accent);
    margin-bottom: 12px;
}

.core-claim h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}

.core-claim p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    max-width: 750px;
    margin: 0 auto;
}

.claim-highlight {
    margin-top: 16px;
    font-size: 1.1rem;
    color: var(--accent);
}

/* ==================== RSTAR ==================== */
.rstar-explainer {
    margin-bottom: 48px;
}

.rstar-explainer h3,
.rstar-timeline h3,
.rstar-numbers h3,
.rstar-critique h3 {
    font-family: var(--font-display);
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 24px;
}

.rstar-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rstar-node {
    background: var(--bg-card);
    border: 2px solid var(--border);
    padding: 16px 20px;
    text-align: center;
    font-size: 0.85rem;
    max-width: 170px;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.rstar-node svg {
    color: var(--accent);
}

.rstar-node:hover {
    border-color: var(--accent);
}

.rstar-node-bad {
    border-color: var(--rust);
    background: var(--rust-light);
}

.rstar-node-bad svg {
    color: var(--rust);
}

.rstar-arrow {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .rstar-flow {
        flex-direction: column;
    }
    .rstar-arrow svg {
        transform: rotate(90deg);
    }
}

.rstar-timeline {
    margin-bottom: 48px;
}

.rstar-events {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--border);
}

.rstar-event {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 16px 20px;
    background: var(--bg-card);
    transition: all var(--transition);
}

.rstar-event:hover {
    background: var(--bg-card-hover);
}

.rstar-event-bad {
    border-left: 4px solid var(--rust);
}

.rstar-date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 700;
    min-width: 90px;
    flex-shrink: 0;
}

.rstar-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.rstar-numbers {
    margin-bottom: 48px;
}

.rstar-compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2px;
    background: var(--border);
}

.rstar-compare-card {
    background: var(--bg-card);
    padding: 24px;
    text-align: center;
    transition: all var(--transition);
}

.rstar-compare-card:hover {
    background: var(--bg-card-hover);
}

.rstar-compare-bad {
    border-top: 4px solid var(--rust);
}

.rstar-compare-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--sky-blue);
    margin-bottom: 4px;
}

.rstar-compare-bad .rstar-compare-value {
    color: var(--rust);
}

.rstar-compare-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.rstar-critique {
    max-width: 700px;
    margin: 0 auto;
}

.rstar-list {
    list-style: none;
}

.rstar-list li {
    padding: 14px 0 14px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    position: relative;
}

.rstar-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20px;
    width: 10px;
    height: 10px;
    background: var(--accent);
    /* Diamond */
    transform: rotate(45deg);
}

/* ==================== SOLUTION ==================== */
.section-solution {
    background: var(--bg-secondary);
}

.solution-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2px;
    background: var(--prairie-green);
    margin-bottom: 48px;
}

.solution-stat {
    padding: 24px;
    text-align: center;
    transition: all var(--transition);
}

[data-theme="dark"] .solution-stat {
    background: var(--bg-card);
}

[data-theme="light"] .solution-stat {
    background: #F0F5EC;
}

.solution-stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--prairie-green);
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

.solution-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.solution-plan {
    max-width: 700px;
    margin: 0 auto 48px;
}

.solution-plan h3 {
    font-family: var(--font-display);
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 24px;
}

.solution-steps {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--prairie-green);
}

.solution-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 20px;
    background: var(--bg-card);
    transition: all var(--transition);
}

.solution-step:hover {
    background: var(--bg-card-hover);
}

.solution-step-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--prairie-green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
}

.solution-step-body h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.solution-step-body p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.solution-quote {
    text-align: center;
    max-width: 750px;
    margin: 0 auto;
}

.solution-quote blockquote {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 16px;
    position: relative;
    font-style: italic;
    padding: 0 24px;
}

.solution-quote blockquote::before {
    content: '\201C';
    font-family: var(--font-display);
    font-size: 4rem;
    color: var(--prairie-green);
    opacity: 0.4;
    position: absolute;
    top: -16px;
    left: -8px;
    line-height: 1;
    font-style: normal;
}

.solution-quote cite {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: normal;
    font-family: var(--font-mono);
}

/* ==================== NETWORK ==================== */
.network-container {
    background: var(--bg-card);
    border: 2px solid var(--border);
    overflow: hidden;
    margin-bottom: 24px;
    transition: all var(--transition);
}

#network-canvas {
    width: 100%;
    height: 600px;
    display: block;
}

.network-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.legend-swatch {
    width: 12px;
    height: 12px;
}

.legend-gov { background: var(--sky-blue); }
.legend-corp { background: var(--accent); }
.legend-reg { background: #8A6CAA; }
.legend-fin { background: var(--rust); }
.legend-civil { background: var(--prairie-green); }

/* ==================== CONTACT ==================== */
.contact-wrapper {
    max-width: 640px;
    margin: 0 auto;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

@media (max-width: 520px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

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

.form-group label {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    color: var(--text-primary);
    transition: border-color var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23A09080' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-submit {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 14px 32px;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    align-self: flex-start;
}

.form-submit:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.form-status {
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.form-status.success {
    background: var(--prairie-green-light);
    border: 1px solid var(--prairie-green);
    color: var(--prairie-green);
}

.form-status.error {
    background: var(--rust-light);
    border: 1px solid var(--rust);
    color: var(--rust);
}

/* ==================== SOURCES ==================== */
.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2px;
    background: var(--border);
}

.source-card {
    background: var(--bg-card);
    padding: 24px;
    transition: all var(--transition);
}

.source-card:hover {
    background: var(--bg-card-hover);
}

.source-card-researcher {
    grid-column: 1 / -1;
    border-left: 4px solid var(--accent);
}

.source-card h4 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

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

.source-card a {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 8px;
}

/* ==================== FOOTER ==================== */
#footer {
    padding: 60px 0;
    border-top: 2px solid var(--border);
    background: var(--bg-primary);
    transition: all var(--transition);
}

.footer-content {
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.footer-brand span {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.footer-derrick {
    color: var(--accent);
}

.footer-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

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

.footer-copy {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* ==================== PULL QUOTE DIVIDER ==================== */
.pull-quote-divider {
    padding: 60px 24px;
    text-align: center;
    background: var(--bg-primary);
    border-top: 2px solid var(--border);
    border-bottom: 2px solid var(--border);
    transition: all var(--transition);
}

.pull-quote-divider blockquote {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 600;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--accent);
    max-width: 800px;
    margin: 0 auto;
}

/* ==================== SCROLL PROGRESS ==================== */
.scroll-progress-track {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border);
    z-index: 999;
    overflow: hidden;
}

.scroll-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--rust));
    transition: width 0.1s linear;
}

/* ==================== SCALE COMPARISON ==================== */
.scale-comparison {
    margin-top: 40px;
    margin-bottom: 8px;
}

.scale-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2px;
    background: var(--border);
}

.scale-card {
    background: var(--bg-card);
    padding: 24px;
    text-align: center;
    transition: all var(--transition);
}

.scale-card:hover {
    background: var(--bg-card-hover);
}

.scale-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.scale-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* (Per-person toggle styles removed) */

/* ==================== REVEAL ANIMATION ==================== */
[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== SCROLLBAR ==================== */
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) var(--bg-primary);
}

/* Webkit */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-light);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .section {
        padding: 70px 0;
    }

    .hero-stats-row {
        gap: 16px;
    }

    .hero-stat-divider {
        display: none;
    }

    .hero-title {
        font-size: clamp(2.8rem, 12vw, 5rem);
    }

    .viz-panel {
        padding: 20px;
    }

    .liability-scale {
        flex-direction: column;
    }

    .liability-vs {
        transform: rotate(90deg);
    }

    .barrel-chart {
        gap: 12px;
    }

    .pipeline-step {
        flex-direction: column;
    }

    .rstar-event {
        flex-direction: column;
        gap: 4px;
    }

    #sankey-canvas {
        height: 300px;
    }

    #network-canvas {
        height: 450px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .sources-grid {
        grid-template-columns: 1fr;
    }

    .hero-badge {
        font-size: 0.6rem;
        padding: 6px 14px;
    }

    .section-title {
        font-size: clamp(1.6rem, 6vw, 2.4rem);
    }
}

/* ==================== SAFARI SPECIFIC FIXES ==================== */
/* Safari doesn't support gap in some flex contexts pre-iOS 14.5 */
@supports not (gap: 1px) {
    .hero-stats-row > * + * {
        margin-left: 28px;
    }
    .nav-links > * + * {
        margin-left: 2px;
    }
}

/* Safari: fix 100vh including browser chrome */
@supports (-webkit-touch-callout: none) {
    .hero-section {
        min-height: -webkit-fill-available;
    }
}

/* Safari: prevent elastic scrolling from showing background */
@media (hover: none) and (pointer: coarse) {
    /* Mobile: disable parallax for performance */
    .parallax-layer {
        transform: none !important;
    }
    .hero-content {
        transform: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border: #555;
        --text-secondary: #ccc;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }

    .parallax-layer,
    .hero-content {
        transform: none !important;
    }
}

/* Print styles */
@media print {
    #main-nav,
    .scroll-indicator,
    .pipeline-divider,
    .theme-toggle,
    .hero-parallax-bg,
    #contact {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .section {
        padding: 20px 0;
        min-height: auto;
        page-break-inside: avoid;
    }
}

/* ==================== ROYALTY SIMULATOR ==================== */
.royalty-sim-panel {
    overflow: visible;
}
.royalty-sim {
    margin-top: 1.5rem;
}
.sim-slider-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.sim-slider-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sim-slider-track-wrapper {
    flex: 1;
    min-width: 200px;
    position: relative;
    padding-bottom: 24px;
}
.sim-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--rust), var(--accent), var(--prairie-green));
    outline: none;
    cursor: pointer;
}
.sim-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 12px var(--accent-glow), 0 2px 8px rgba(0,0,0,0.3);
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sim-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 20px var(--accent-glow), 0 2px 12px rgba(0,0,0,0.4);
}
.sim-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.1);
}
.sim-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 12px var(--accent-glow), 0 2px 8px rgba(0,0,0,0.3);
    cursor: grab;
}
.sim-slider-markers {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
}
.sim-marker {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    white-space: nowrap;
}
.sim-marker::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 6px;
    background: var(--text-muted);
}
.sim-marker::after {
    content: attr(data-label);
}
.sim-rate-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.sim-rate-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}
.sim-rate-pct {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
}
.sim-rate-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.sim-results {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.sim-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem 1rem;
    text-align: center;
    transition: border-color var(--transition), transform var(--transition);
}
.sim-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.sim-card-icon {
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.sim-card-value {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.sim-card-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
}
.sim-card-delta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    min-height: 1.2em;
    font-weight: 600;
}
.sim-card-delta.positive {
    color: var(--prairie-green);
}
.sim-card-delta.negative {
    color: var(--rust);
}
.sim-comparison {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
}
.sim-compare-bar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.sim-compare-row {
    display: grid;
    grid-template-columns: 100px 1fr 120px;
    align-items: center;
    gap: 0.75rem;
}
.sim-compare-label {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    text-align: right;
}
.sim-compare-track {
    height: 20px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}
.sim-compare-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 2px;
}
.sim-compare-alberta {
    background: var(--rust);
}
.sim-compare-scenario {
    background: var(--accent);
}
.sim-compare-norway {
    background: var(--prairie-green);
}
.sim-compare-val {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-primary);
}
.sim-footnote {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 1rem;
    font-style: italic;
}

@media (max-width: 768px) {
    .sim-results {
        grid-template-columns: repeat(2, 1fr);
    }
    .sim-slider-row {
        flex-direction: column;
        align-items: stretch;
    }
    .sim-rate-display {
        flex-direction: row;
        gap: 0.5rem;
        justify-content: center;
    }
    .sim-compare-row {
        grid-template-columns: 70px 1fr 90px;
        gap: 0.5rem;
    }
    .sim-card-value {
        font-size: 1.2rem;
    }
}

/* ==================== RACING COUNTERS ==================== */
.racing-counters {
    margin: 3rem auto 2rem;
    padding: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid var(--rust);
    border-radius: 0;
    max-width: 620px;
    width: 100%;
    opacity: 0;
    transform: translateY(10px);
    animation: raceAppear 0.8s ease 2s forwards;
    box-shadow: 0 0 40px rgba(180, 60, 30, 0.15), inset 0 0 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}
@keyframes raceAppear {
    to { opacity: 1; transform: translateY(0); }
}
.race-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--rust);
    padding: 0.5rem 1.5rem;
    background: rgba(180, 60, 30, 0.12);
    border-bottom: 1px solid rgba(180, 60, 30, 0.25);
}
.race-label svg {
    flex-shrink: 0;
    color: var(--rust);
}
.race-tracks {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.race-track {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.race-track:last-child {
    border-bottom: none;
}
.race-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    opacity: 0.15;
    z-index: 0;
}
.race-liability .race-bar { background: var(--rust); }
.race-profit .race-bar { background: var(--accent); }
.race-cleanup .race-bar { background: var(--prairie-green); }
.race-flash {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    pointer-events: none;
    opacity: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.race-flash.active {
    animation: raceFlash 2.5s ease forwards;
}
@keyframes raceFlash {
    0% { opacity: 0; }
    8% { opacity: 1; }
    75% { opacity: 1; }
    100% { opacity: 0; }
}
.race-liability .race-flash { color: var(--rust); border-left: 4px solid var(--rust); }
.race-profit .race-flash { color: var(--accent); border-left: 4px solid var(--accent); }
.race-cleanup .race-flash { color: var(--prairie-green); border-left: 4px solid var(--prairie-green); }
.race-icon {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
}
.race-liability .race-icon { color: var(--rust); }
.race-profit .race-icon { color: var(--accent); }
.race-cleanup .race-icon { color: var(--prairie-green); }
.race-info {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}
.race-counter {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.race-liability .race-counter { color: var(--rust); }
.race-profit .race-counter { color: var(--accent); }
.race-cleanup .race-counter { color: var(--prairie-green); }
.race-desc {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

[data-theme="light"] .racing-counters {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .race-track {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .race-bar {
    opacity: 0.1;
}
[data-theme="light"] .race-flash {
    background: rgba(255, 255, 255, 0.9);
}

@media (max-width: 768px) {
    .racing-counters {
        margin: 2rem auto 1.5rem;
        max-width: 100%;
    }
    .race-track {
        padding: 0.4rem 1rem;
        gap: 0.5rem;
    }
    .race-counter {
        font-size: 1.4rem;
    }
    .race-icon {
        width: 22px;
        height: 22px;
    }
    .race-icon svg {
        width: 20px;
        height: 20px;
    }
    .race-desc {
        font-size: 0.6rem;
    }
    .race-flash {
        font-size: 0.7rem;
    }
}

/* ==================== SCROLL PIPELINE ==================== */
.scroll-pipeline {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.scroll-pipeline.visible {
    opacity: 1;
    pointer-events: auto;
}
.sp-header {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--accent);
    text-align: center;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    position: absolute;
    left: -18px;
    top: 50%;
    transform: rotate(180deg) translateX(50%);
    white-space: nowrap;
    opacity: 0.6;
}
.sp-pipe {
    position: relative;
    width: 4px;
    background: var(--border);
    border-radius: 2px;
    height: 320px;
    overflow: visible;
}
.sp-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to bottom, var(--accent), var(--rust));
    border-radius: 2px;
    transition: height 0.15s linear;
    box-shadow: 0 0 10px rgba(212, 144, 30, 0.3);
}
.sp-nodes {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px 0;
}
.sp-node {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.sp-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 3px solid var(--border);
    transition: all 0.3s ease;
    z-index: 2;
    flex-shrink: 0;
}
.sp-node.passed .sp-dot {
    background: var(--rust);
    border-color: var(--rust);
    box-shadow: 0 0 6px rgba(180, 60, 30, 0.3);
}
.sp-node.active .sp-dot {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.3);
    box-shadow: 0 0 12px var(--accent-glow);
}
.sp-tag {
    position: absolute;
    left: calc(100% + 12px);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    background: var(--bg-card);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px var(--shadow);
}
.sp-node.active .sp-tag,
.sp-node:hover .sp-tag {
    opacity: 1;
    transform: translateX(0);
}
.sp-amount {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}
.sp-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

@media (max-width: 1100px) {
    .scroll-pipeline {
        display: none;
    }
}

/* ==================== WELL FIELD DRILL-DOWN ==================== */
.well-field-wrapper {
    position: relative;
}
.well-drilldown {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 1.25rem;
    width: 240px;
    box-shadow: 0 8px 32px var(--shadow);
    z-index: 10;
    animation: ddAppear 0.3s ease;
}
@keyframes ddAppear {
    from { opacity: 0; transform: translateY(-50%) scale(0.95); }
    to { opacity: 1; transform: translateY(-50%) scale(1); }
}
.well-drilldown-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
}
.well-drilldown-close:hover { color: var(--text-primary); }
.well-dd-region {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.75rem;
    padding-right: 20px;
}
.well-dd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}
.well-dd-stat {
    display: flex;
    flex-direction: column;
}
.well-dd-val {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}
.well-dd-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.well-dd-sparkline {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.well-dd-sparkline canvas {
    width: 100%;
    height: 40px;
    display: block;
}
.well-dd-spark-label {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .well-drilldown {
        position: fixed;
        z-index: 100;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        width: 100%;
        border-radius: 12px 12px 0 0;
        animation: ddSlideUp 0.3s ease;
    }
    @keyframes ddSlideUp {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

/* ==================== DOCUMENT VIEWER ==================== */
.doc-viewer-overlay[hidden] {
    display: none !important;
}
.doc-viewer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: docFade 0.3s ease;
}
@keyframes docFade {
    from { opacity: 0; }
    to { opacity: 1; }
}
.doc-viewer-modal {
    background: #F5F0E0;
    color: #1A1A1A;
    border: 2px solid #8B7355;
    border-radius: 4px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: docSlide 0.4s ease;
    font-family: 'Courier New', monospace;
}
@keyframes docSlide {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.doc-viewer-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-bottom: 2px dashed #8B7355;
    gap: 1rem;
}
.doc-stamp {
    font-weight: 700;
    font-size: 0.85rem;
    color: #C41E3A;
    border: 2px solid #C41E3A;
    padding: 2px 8px;
    letter-spacing: 0.15em;
    transform: rotate(-2deg);
    display: inline-block;
}
.doc-viewer-overlay.declassified .doc-stamp {
    color: #2E7D32;
    border-color: #2E7D32;
}
.doc-ref {
    font-size: 0.7rem;
    color: #6B5B47;
    flex: 1;
}
.doc-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #6B5B47;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.doc-close:hover { color: #1A1A1A; }
.doc-body {
    padding: 1.5rem 1.25rem;
}
.doc-title {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.doc-date {
    font-size: 0.75rem;
    color: #6B5B47;
    margin-bottom: 1rem;
    border-bottom: 1px solid #C4B8A0;
    padding-bottom: 0.75rem;
}
.doc-content {
    font-size: 0.85rem;
    line-height: 1.7;
    color: #1A1A1A;
}
.doc-content p {
    margin-bottom: 0.75rem;
}
.doc-content .redacted {
    background: #1A1A1A;
    color: #1A1A1A;
    padding: 0 4px;
    border-radius: 2px;
    transition: background 0.8s ease, color 0.8s ease;
    cursor: default;
    user-select: none;
}
.doc-viewer-overlay.declassified .doc-content .redacted {
    background: rgba(46, 125, 50, 0.15);
    color: #1A1A1A;
}
.doc-content .typewriter .redacted {
    background: #1A1A1A;
    color: #1A1A1A;
}
.doc-viewer-overlay.declassified .doc-content .typewriter .redacted {
    background: rgba(46, 125, 50, 0.15);
    color: #1A1A1A;
}
.doc-footer {
    padding: 0.75rem 1.25rem;
    border-top: 2px dashed #8B7355;
    text-align: center;
}
.doc-declassify-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #C41E3A;
    color: #fff;
    border: none;
    padding: 0.6rem 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.3s ease;
}
.doc-declassify-btn:hover {
    background: #A01830;
}
.doc-viewer-overlay.declassified .doc-declassify-btn {
    background: #2E7D32;
    pointer-events: none;
}
.doc-viewer-overlay.declassified .doc-declassify-btn::after {
    content: ' ✓';
}

@media (max-width: 768px) {
    .doc-viewer-overlay {
        padding: 1rem;
    }
    .doc-viewer-modal {
        max-height: 90vh;
    }
}
/* ==================== AUDIO TOGGLE ==================== */
.audio-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 95;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all var(--transition);
    opacity: 0;
    transform: translateY(10px);
    animation: raceAppear 0.6s ease 3s forwards;
}
.audio-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.audio-toggle.active {
    border-color: var(--prairie-green);
    color: var(--prairie-green);
}
.audio-toggle.active .audio-icon-off { display: none; }
.audio-toggle.active .audio-icon-on { display: block !important; }
.audio-toggle:not(.active) .audio-icon-on { display: none; }
.audio-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.audio-label {
    line-height: 1;
}

@media (max-width: 768px) {
    .audio-toggle {
        bottom: 60px;
        left: 10px;
        padding: 0.4rem 0.6rem;
    }
}

/* ==================== YOUR SHARE WIDGET ==================== */
.your-share {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 95;
    min-width: 240px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}
.your-share.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.your-share-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.6rem 1rem;
    background: var(--bg-card);
    border: 2px solid var(--rust);
    border-bottom: 1px solid rgba(180, 60, 30, 0.3);
    border-radius: 0;
    color: var(--rust);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: background var(--transition);
}
.your-share-toggle:focus-visible {
    outline: 2px solid var(--rust);
    outline-offset: 2px;
}
.your-share.collapsed .your-share-toggle {
    border-bottom: 2px solid var(--rust);
}
.your-share-toggle:hover {
    background: rgba(180, 60, 30, 0.08);
}
.your-share-chevron {
    margin-left: auto;
    transition: transform 0.3s ease;
    color: var(--rust);
}
.your-share.collapsed .your-share-chevron {
    transform: rotate(180deg);
}
.your-share-body {
    background: var(--bg-card);
    border: 2px solid var(--rust);
    border-top: none;
    border-radius: 0;
    padding: 0.75rem 1rem;
    overflow: hidden;
    max-height: 200px;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 4px 20px rgba(180, 60, 30, 0.15);
}
.your-share.collapsed .your-share-body {
    max-height: 0;
    padding: 0 1rem;
    opacity: 0;
    border: none;
}
.your-share-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
}
.your-share-total {
    border-top: 2px solid var(--rust);
    margin-top: 0.35rem;
    padding-top: 0.5rem;
}
.ys-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.ys-value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.3s ease;
}
.ys-value.updated {
    color: var(--rust);
}
.your-share-total .ys-value {
    color: var(--rust);
    font-size: 1rem;
}

@media (max-width: 768px) {
    .your-share {
        bottom: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* ==================== COMPARATIVE TIMELINE ==================== */
.timeline-context-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.timeline-context-toggle:hover,
.timeline-context-toggle.active {
    border-color: var(--sky-blue);
    color: var(--sky-blue);
    background: var(--sky-blue-light);
}
.timeline-context-item {
    border-left-color: var(--sky-blue) !important;
}
.timeline-context-item .timeline-marker {
    background: var(--sky-blue) !important;
    box-shadow: 0 0 8px var(--sky-blue-light);
}
.timeline-context-item .timeline-header {
    opacity: 0.85;
}
/* ==================== SANKEY EXPLODE ==================== */
.sankey-explode {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 0;
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    animation: ddAppear 0.3s ease;
}
.sankey-explode-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}
.sankey-explode-close:hover { color: var(--text-primary); }
.sankey-explode-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1rem;
    padding-right: 20px;
}
.sankey-explode-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.sankey-sub-row {
    display: grid;
    grid-template-columns: 130px 1fr 70px;
    align-items: center;
    gap: 0.75rem;
}
.sankey-sub-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
}
.sankey-sub-track {
    height: 18px;
    background: var(--bg-secondary);
    border-radius: 0;
    overflow: hidden;
}
.sankey-sub-fill {
    height: 100%;
    border-radius: 0;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.sankey-sub-fill.accent { background: var(--accent); }
.sankey-sub-fill.rust { background: var(--rust); }
.sankey-sub-fill.green { background: var(--prairie-green); }
.sankey-sub-fill.muted { background: var(--text-muted); }
.sankey-sub-fill.blue { background: var(--sky-blue); }
.sankey-sub-val {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .sankey-sub-row {
        grid-template-columns: 90px 1fr 60px;
    }
}

.timeline-context-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--sky-blue-light);
    color: var(--sky-blue);
    border: 1px solid var(--sky-blue);
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* ==================== NETWORK DOSSIER ==================== */
.network-container {
    position: relative;
}
.network-dossier {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 1.5rem auto 0;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 0;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 8px 32px var(--shadow);
    z-index: 10;
    animation: ddAppear 0.3s ease;
}
.dossier-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
}
.dossier-close:hover { color: var(--text-primary); }
.dossier-type {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 2px 8px;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 0.5rem;
}
.dossier-type.gov { background: var(--sky-blue-light); color: var(--sky-blue); border: 1px solid var(--sky-blue); }
.dossier-type.corp { background: var(--accent-glow); color: var(--accent); border: 1px solid var(--accent); }
.dossier-type.reg { background: rgba(138,108,170,0.15); color: #8A6CAA; border: 1px solid #8A6CAA; }
.dossier-type.fin { background: var(--rust-light); color: var(--rust); border: 1px solid var(--rust); }
.dossier-type.civil { background: var(--prairie-green-light); color: var(--prairie-green); border: 1px solid var(--prairie-green); }
.dossier-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    padding-right: 20px;
}
.dossier-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}
.dossier-connections {
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
}
.dossier-conn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0;
    font-size: 0.7rem;
}
.dossier-conn-arrow {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.65rem;
}
.dossier-conn-label {
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.dossier-conn-target {
    color: var(--text-primary);
    font-weight: 600;
}

@media (max-width: 768px) {
    .network-dossier {
        margin: 1rem auto 0;
        padding: 1rem;
    }
}

.timeline-doc-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 0;
    padding: 2px 6px;
    margin-left: 0.5rem;
    vertical-align: middle;
    cursor: pointer;
    transition: background var(--transition);
}
.timeline-doc-badge:hover {
    background: var(--accent);
    color: var(--bg-primary);
}
