/* ============================================
   PROCEDURAL KNOWLEDGE RESEARCH - Minimal Design
   ============================================ */

/* Color System - Cool Gray with Subtle Accents */
:root {
    /* Cool gray scale */
    --color-dark: #18181B;
    --color-light: #FAFAFA;
    --color-gray-50: #FAFAFA;
    --color-gray-100: #F4F4F5;
    --color-gray-200: #E4E4E7;
    --color-gray-300: #D4D4D8;
    --color-gray-400: #A1A1AA;
    --color-gray-500: #71717A;
    --color-gray-600: #52525B;
    --color-gray-700: #3F3F46;
    --color-gray-800: #27272A;
    
    /* Text colors */
    --color-text: #18181B;
    --color-text-secondary: #52525B;
    --color-text-muted: #71717A;
    
    /* Accent - subtle blue for links/interactive */
    --color-accent: #2563EB;
    --color-accent-light: #EFF6FF;
    
    /* Semantic colors */
    --color-primary: #18181B;
    --color-primary-hover: #3F3F46;
    --color-highlight: #F4F4F5;
    --color-highlight-border: #D4D4D8;
    
    /* Borders */
    --color-border: #D4D4D8;
    --color-border-light: #E4E4E7;
    
    /* Transitions */
    --transition-base: 0.15s ease;
    
    /* No shadows */
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-xl: none;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Palatino Linotype', 'Palatino', 'Book Antiqua', Georgia, serif;
    font-weight: 400;
    line-height: 1.7;
    font-size: 17px;
    color: var(--color-text);
    background-color: var(--color-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Layout with left sidebar */
.page-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: 220px;
    min-height: 100vh;
}

@media (max-width: 900px) {
    .main-content {
        margin-left: 0;
        margin-top: 60px;
    }
}

/* Container */
.container {
    max-width: 840px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Wide container for figure-heavy sections */
.container-wide {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Typography - Optima Headers */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Optima', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--color-dark);
    letter-spacing: -0.01em;
}

h1 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: 1.625rem;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    font-weight: 700;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

h2:first-of-type {
    margin-top: 0;
}

h2.no-border {
    border-bottom: none;
    padding-bottom: 0;
}

h2.subsection-title {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: none;
    padding-bottom: 0;
}

h3 {
    font-size: 1.1875rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--color-dark);
}

h3:first-of-type {
    margin-top: 0;
}

h4 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

h4:first-of-type {
    margin-top: 0;
}

h5 {
    font-size: 1.0625rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

h6 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-coral);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* MDX Content Headers */
:global(h3) {
    font-size: 1.375rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--color-dark);
}

:global(h3:first-of-type) {
    margin-top: 0;
}

:global(h4) {
    font-size: 1.125rem;
    margin-top: 2rem;
    margin-bottom: 0.875rem;
    font-weight: 700;
    color: var(--color-text);
}

:global(h4:first-of-type) {
    margin-top: 0;
}

/* Paragraphs */
p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--color-text);
}

p:last-child {
    margin-bottom: 0;
}

h2 + p, h3 + p, h4 + p {
    margin-top: 0;
}

strong {
    font-weight: 700;
    color: var(--color-dark);
}

em {
    font-style: italic;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-base);
}

a:hover {
    border-bottom-color: var(--color-primary);
}

/* Lists - Clear and Readable */
ul, ol {
    margin: 1.5rem 0;
    padding-left: 0;
}

ul {
    list-style: none;
}

ul li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.875rem;
    line-height: 1.75;
    font-size: 1rem;
    color: var(--color-text);
}

ul li:last-child {
    margin-bottom: 0;
}

ul li strong {
    font-weight: 700;
    color: var(--color-dark);
}

ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.5rem;
    color: var(--color-coral);
}

ol {
    list-style: decimal;
    padding-left: 1.75rem;
}

ol li {
    margin-bottom: 0.875rem;
    padding-left: 0.5rem;
    line-height: 1.75;
    font-size: 1rem;
    color: var(--color-text);
}

ol li:last-child {
    margin-bottom: 0;
}

ol li strong {
    font-weight: 700;
    color: var(--color-dark);
}

/* Nested lists */
ul ul, ol ul {
    margin: 0.75rem 0 0.75rem 1rem;
}

ul ul li::before {
    background: transparent;
    border: 1.5px solid var(--color-gray-500);
}

ol ol {
    margin: 0.75rem 0 0.75rem 1rem;
}

/* Section Styles - Clean Minimal */
section {
    padding: 3rem 0;
    border-bottom: 1px solid var(--color-border-light);
    scroll-margin-top: 20px;
}

section:last-of-type {
    border-bottom: none;
}

.section-dark,
.section-light {
    background-color: var(--color-light);
}

.section-title {
    font-family: 'Optima', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
    color: var(--color-dark);
}

.section-intro {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* Summary Cards - Minimal */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.summary-card {
    background: var(--color-gray-50);
    border-radius: 2px;
    padding: 1.25rem;
    border: 1px solid var(--color-border-light);
}

.summary-card-icon {
    width: 32px;
    height: 32px;
    background: var(--color-gray-200);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.summary-card-number {
    font-family: 'Optima', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.summary-card h4 {
    font-family: 'Optima', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1rem;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.summary-card p {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

.summary-card .metric {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--color-coral);
    display: block;
    margin-bottom: 0.25rem;
}

/* Tables - Minimal */
table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: var(--color-light);
}

table caption {
    caption-side: top;
    padding: 0 0 0.5rem 0;
    font-family: 'Optima', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    text-align: left;
}

table caption strong {
    color: var(--color-dark);
    font-weight: 600;
}

table th,
table td {
    padding: 0.625rem 0.75rem;
    text-align: left;
    vertical-align: middle;
    line-height: 1.5;
    border-bottom: 1px solid var(--color-border-light);
}

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

table th {
    font-family: 'Optima', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--color-gray-50);
    color: var(--color-dark);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-border);
}

table tbody tr:nth-child(even) {
    background: var(--color-gray-50);
}

table tbody tr:hover {
    background: var(--color-gray-100);
}

table tr.highlight {
    background: var(--color-gray-100) !important;
}

table tr.highlight td {
    font-weight: 600;
}

table td strong {
    font-weight: 600;
    color: var(--color-dark);
}

/* First column styling for row labels */
table td:first-child {
    font-family: 'Crimson Pro', Georgia, serif;
    font-weight: 600;
    color: var(--color-navy);
}

/* Tables in sections */
.section-light table,
.section-dark table {
    background: var(--color-light);
}

/* Research Figures - Prominent display */
.research-figure {
    margin: 2rem auto;
    text-align: center;
    max-width: 100%;
}

.research-figure img {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    max-height: 500px !important;
    height: auto !important;
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    margin: 0 auto 1rem auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    object-fit: contain !important;
    background: #fff;
}

.research-figure.full-width img {
    max-height: 600px !important;
    max-width: 100% !important;
}

.research-figure-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2rem auto;
    max-width: 100%;
}

.research-figure-grid .research-figure {
    margin: 0;
    max-width: 100%;
}

.research-figure-grid .research-figure img {
    max-width: 100% !important;
    max-height: 320px !important;
    height: auto !important;
}

/* Featured figure gallery - minimal */
.figure-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--color-gray-50);
    border-radius: 2px;
    border: 1px solid var(--color-border-light);
}

.figure-gallery .research-figure img {
    max-height: 450px !important;
    border: 1px solid var(--color-border-light);
}

.figure-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .figure-gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .figure-gallery {
        padding: 1.5rem;
    }
}

@media (max-width: 640px) {
    .research-figure-grid {
        grid-template-columns: 1fr;
        max-width: 280px;
    }
    
    .research-figure {
        max-width: 100%;
    }
    
    .research-figure img {
        max-height: 200px !important;
    }
}

/* Interactive Vega-Lite Charts */
.vega-chart {
    width: 100%;
    max-width: 380px;
    margin: 1.5rem auto;
    min-height: 180px;
    max-height: 260px;
    background: var(--color-gray-50);
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    padding: 0.75rem;
    overflow: hidden;
    position: relative;
}

.vega-chart::before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-gray-50);
    z-index: 1;
    pointer-events: none;
}

.vega-chart.loaded::before {
    display: none;
}

.vega-chart svg {
    max-width: 100%;
    height: auto !important;
}

.research-figure figcaption {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0.5rem auto 0;
    text-align: center;
    padding: 0;
    max-width: 85%;
}

.research-figure figcaption strong {
    color: var(--color-dark);
    font-weight: 600;
}

/* Dashboard Gallery - Small and centered */
.dashboard-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
    max-width: 100%;
    width: 100%;
}

.dashboard-image-wrapper {
    border: 1px solid var(--color-border-light);
    border-radius: 2px;
    overflow: hidden;
    background: var(--color-light);
}

.dashboard-image {
    width: 100% !important;
    height: auto !important;
    max-height: 500px !important;
    object-fit: contain !important;
    display: block !important;
}

.dashboard-image-wrapper figcaption {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    padding: 0.5rem;
    text-align: center;
}

@media (max-width: 640px) {
    .dashboard-gallery {
        grid-template-columns: 1fr;
    }
}

/* Hero Section - Clean Minimal */
.hero {
    padding: 4rem 0 3rem;
    background: var(--color-light);
    border-bottom: 1px solid var(--color-border-light);
    margin-top: 0;
}

.hero-title {
    font-family: 'Optima', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--color-dark);
}

.hero-subtitle {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hero-tagline {
    font-family: 'Optima', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

.hero p {
    color: var(--color-text);
}

.hero strong {
    color: var(--color-dark);
}

/* Stats Grid - Minimal */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--color-gray-50);
    border: 1px solid var(--color-border-light);
    border-radius: 2px;
}

.stat-card {
    text-align: center;
    padding: 0.75rem;
    border-right: 1px solid var(--color-border-light);
}

.stat-card:last-child {
    border-right: none;
}

.stat-value {
    font-family: 'Optima', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-dark);
    display: block;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-family: 'Optima', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.6875rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .stat-card {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }
    
    .stat-card:nth-child(2n) {
        border-left: 1px solid rgba(255, 255, 255, 0.15);
    }
    
    .stat-card:nth-last-child(-n+2) {
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        border-left: none !important;
    }
}

/* Code Blocks - Minimal Dark */
pre {
    margin: 1.5rem 0;
    overflow-x: auto;
    border-radius: 2px;
    background: var(--color-gray-800);
}

code {
    font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', monospace;
    font-size: 0.8125rem;
}

/* Inline code */
p code, li code {
    background: var(--color-gray-100);
    padding: 0.2em 0.4em;
    border-radius: 2px;
    font-size: 0.875em;
    color: var(--color-dark);
    border: 1px solid var(--color-border-light);
}

.hljs, pre code {
    background: var(--color-gray-800) !important;
    color: #e7e5e4 !important;
    padding: 1.25rem 1.5rem !important;
    border-radius: 2px;
    font-size: 0.8125rem;
    line-height: 1.6;
    border: none;
    display: block;
}

/* Buttons - Minimal Style */
.interactive-button {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    background: var(--color-dark);
    color: var(--color-light);
    text-decoration: none;
    border-radius: 2px;
    font-family: 'Optima', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    transition: background var(--transition-base);
    border: none;
    cursor: pointer;
}

.interactive-button:hover {
    background: var(--color-gray-700);
    border: none;
}

.interactive-button.secondary {
    background: transparent;
    color: var(--color-dark);
    border: 1px solid var(--color-border);
}

.interactive-button.secondary:hover {
    background: var(--color-gray-100);
    border-color: var(--color-gray-400);
}

/* Key Findings Box - Minimal */
.key-findings {
    background: var(--color-gray-50);
    border: 1px solid var(--color-border-light);
    border-left: 3px solid var(--color-dark);
    padding: 1.5rem;
    border-radius: 2px;
    margin: 1.5rem 0;
}

.key-findings h3 {
    margin-top: 0;
    font-family: 'Optima', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    color: var(--color-text-secondary);
    font-weight: 600;
}

.key-findings ul {
    margin-bottom: 0;
}

.key-findings li {
    margin-bottom: 0.875rem;
    font-size: 1rem;
    line-height: 1.7;
}

.key-findings li:last-child {
    margin-bottom: 0;
}

.key-findings li::before {
    background: var(--color-coral);
}

.key-findings strong {
    color: var(--color-navy);
}

/* Cascade Types */
.cascade-types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.cascade-type {
    background: var(--color-light);
    border: 2px solid var(--color-border-light);
    border-radius: 8px;
    padding: 1.25rem;
}

.cascade-type strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
    color: var(--color-dark);
}

.cascade-type p {
    font-size: 0.875rem;
    margin-bottom: 0;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .cascade-types {
        grid-template-columns: 1fr;
    }
}

/* Footer - Minimal */
.footer {
    padding: 3rem 0;
    background: var(--color-gray-50);
    border-top: 1px solid var(--color-border-light);
    color: var(--color-text-secondary);
    text-align: center;
}

.footer-content {
    font-family: 'Optima', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
}

.footer p {
    margin-bottom: 0.5rem;
    color: var(--color-text-secondary);
}

.footer p strong {
    color: var(--color-dark);
    font-size: 0.9375rem;
}

.footer a {
    color: var(--color-dark);
    font-weight: 500;
    border-bottom: 1px solid var(--color-border);
    transition: all var(--transition-base);
}

.footer a:hover {
    color: var(--color-text);
    border-bottom-color: var(--color-dark);
}

/* Animations - Subtle */
.fade-in {
    opacity: 1;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utility Classes */
.mt-4 { margin-top: 2rem; }
.mb-4 { margin-bottom: 2rem; }
.text-center { text-align: center; }

/* Content Sections */
.content-section {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--color-border-light);
}

.content-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.subsection {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border-light);
}

.subsection:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Nested subsections */
.subsection .subsection {
    margin-top: 2rem;
    padding-top: 1.5rem;
    padding-left: 1.5rem;
    border-left: 3px solid var(--color-border-light);
    border-top: none;
}

.intro-text {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
}

.lead-paragraph {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--color-text);
    margin-bottom: 1.75rem;
}

.callout-box {
    background: var(--color-gray-50);
    border-left: 3px solid var(--color-dark);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 2px 2px 0;
}

.callout-box p {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    line-height: 1.7;
}

.callout-box p:last-child {
    margin-bottom: 0;
}

.callout-box strong {
    color: var(--color-navy);
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border-light);
    justify-content: center;
}

/* Table Container */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 2rem 0;
    width: 100%;
}

.table-container table {
    min-width: 100%;
    margin: 0;
}

@media (max-width: 768px) {
    .table-container {
        margin: 1.5rem -1rem;
        padding: 0 1rem;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    table th,
    table td {
        padding: 0.5rem 0.625rem;
    }
    
    table th {
        font-size: 0.6875rem;
    }
}

.table-figure {
    margin: 0;
}

.table-figure figcaption {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    margin-top: 0.5rem;
}

/* Rung List - Numbered representation rungs */
.rung-list {
    margin: 1.5rem 0;
    padding: 0;
}

.rung-list p {
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--color-gray-50);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 6px 6px 0;
}

.rung-list p:last-child {
    margin-bottom: 0;
}

.rung-list strong:first-child {
    color: var(--color-dark);
    font-weight: 700;
}

.rung-list em {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    font-style: italic;
}

.rung-list code {
    background: var(--color-gray-100);
    padding: 0.15em 0.35em;
    border-radius: 3px;
    font-size: 0.875em;
}

/* MDX content improvements */
:global(.table-container) {
    overflow-x: auto;
    margin: 2rem 0;
}

:global(.table-container table) {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 2px solid #333 !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

:global(.table-container th),
:global(.table-container td) {
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid #ccc !important;
    border-right: 1px solid #ccc !important;
}

:global(.table-container th) {
    background: #2a2a2a !important;
    color: #fff !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 0.8125rem !important;
    letter-spacing: 0.04em !important;
    border-bottom: 2px solid #333 !important;
    border-right-color: #444 !important;
}

:global(.table-container th:last-child),
:global(.table-container td:last-child) {
    border-right: none !important;
}

:global(.table-container tbody tr:last-child td) {
    border-bottom: none !important;
}

:global(.table-container tbody tr:nth-child(odd)) {
    background: #fff !important;
}

:global(.table-container tbody tr:nth-child(even)) {
    background: #f5f5f5 !important;
}

:global(.table-container tbody tr:hover) {
    background: #e8f4fc !important;
}

:global(.table-container tr.highlight) {
    background: #fff8e1 !important;
}

/* Global image constraints - always fit container */
img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

/* Blockquotes */
blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    border-left: 4px solid var(--color-primary);
    background: var(--color-gray-50);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--color-text-secondary);
}

blockquote p {
    margin-bottom: 0.75rem;
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* Definition lists */
dl {
    margin: 1.5rem 0;
}

dt {
    font-weight: 700;
    color: var(--color-dark);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

dd {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.75;
}

/* Navigation Styles - Left Sidebar */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background: var(--color-light);
    border-right: 1px solid var(--color-border-light);
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem 0;
}

.main-nav.scrolled {
    /* No change for sidebar */
}

/* Progress indicator - vertical on sidebar */
.nav-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 0%;
    background: var(--color-dark);
    transition: height 0.1s linear;
}

.nav-container {
    display: flex;
    flex-direction: column;
    padding: 0 1.25rem;
    height: auto;
}

.nav-logo {
    font-family: 'Optima', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-dark);
    text-decoration: none;
    border: none;
    margin-bottom: 2rem;
    line-height: 1.4;
}

.nav-logo:hover {
    color: var(--color-text-secondary);
    border: none;
}

.nav-links {
    display: flex;
    flex-direction: column;
    list-style: none;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
}

.nav-link {
    font-family: 'Optima', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    border: none;
    padding: 0.5rem 0.75rem;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    border-radius: 2px;
    font-weight: 500;
    transition: all var(--transition-base);
}

.nav-link:hover {
    color: var(--color-dark);
    background: var(--color-gray-100);
    border: none;
}

.nav-link.active {
    color: var(--color-dark);
    background: var(--color-gray-100);
    border: none;
}

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

.nav-toggle span {
    width: 20px;
    height: 2px;
    background: var(--color-dark);
    transition: all 0.2s ease;
}

/* Mobile: Top bar instead of sidebar */
@media (max-width: 900px) {
    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 60px;
        border-right: none;
        border-bottom: 1px solid var(--color-border-light);
        padding: 0;
        overflow: visible;
    }
    
    .nav-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        height: 60px;
        padding: 0 1rem;
    }
    
    .nav-logo {
        margin-bottom: 0;
    }
    
    .nav-links {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--color-light);
        border-bottom: 1px solid var(--color-border-light);
        padding: 1rem;
        display: none;
        flex-direction: column;
        gap: 0;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
        margin: 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-progress {
        position: absolute;
        top: auto;
        bottom: 0;
        left: 0;
        width: 0%;
        height: 2px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        flex-direction: column;
    }
    
    .hero-subtitle .interactive-button {
        width: 100%;
        text-align: center;
    }
    
    .section-title, h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    section {
        padding: 2.5rem 0;
    }
    
    .dashboard-gallery {
        grid-template-columns: 1fr;
    }
    
    .key-findings {
        padding: 1.25rem 1.5rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

/* Link styles */
a:not(.interactive-button):not(.nav-link):not(.nav-logo):not(.reference-title) {
    color: var(--color-dark);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
}

a:not(.interactive-button):not(.nav-link):not(.nav-logo):not(.reference-title):hover {
    border-bottom-color: var(--color-dark);
}

/* References Section */
.references {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.reference-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border-light);
}

.reference-item:last-child {
    border-bottom: none;
}

.reference-authors {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.reference-title {
    font-family: 'Optima', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-dark);
    text-decoration: none;
    display: block;
    margin-bottom: 0.25rem;
}

.reference-title:hover {
    text-decoration: underline;
}

.reference-venue {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-style: italic;
    display: block;
    margin-bottom: 0.5rem;
}

.reference-note {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Subsection Links */
.subsection-link {
    color: var(--color-dark);
    text-decoration: none;
    border-bottom: none;
}

.subsection-link:hover {
    text-decoration: underline;
}
