/* Base styles */
:root {
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --accent: #2c5282;
    --accent-light: #e8f0f8;
    --border: #e0e0e0;
    --highlight: #fef3c7;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Charter', 'Georgia', serif;
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3.5rem;
    text-align: center;
    margin-top: 3rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.8rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-top: 2rem;
}

h4 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
}

p {
    margin-bottom: 1.2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border);
}

.subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.5rem;
}

/* Navigation */
nav {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: center;
    z-index: 100;
}

nav a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.3rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

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

/* Sections */
section {
    margin-bottom: 4rem;
    padding-top: 1rem;
}

/* Equation boxes */
.equation-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
    font-size: 1.1rem;
    overflow-x: auto;
}

.equation-box.highlight {
    background: var(--highlight);
    border-color: #d4a853;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

th, td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

tr:hover {
    background: var(--accent-light);
}

.summary-table th,
.data-table th,
.bounds-table th,
.predictions-table th,
.crossing-table th {
    background: var(--accent);
    color: white;
}

.comparison-table {
    width: auto;
    margin: 1rem auto;
}

.comparison-table td {
    padding: 0.5rem 1.5rem;
}

.comparison-table td:first-child {
    text-align: right;
    color: var(--text-secondary);
}

.comparison-table td:last-child {
    font-weight: 600;
}

.concept-table td:first-child {
    width: 30%;
    vertical-align: top;
}

/* Key result boxes */
.key-result {
    background: var(--accent-light);
    border-left: 4px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
}

.theorem-box {
    background: var(--bg-secondary);
    border: 2px solid var(--accent);
    border-radius: 4px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.theorem-box h4 {
    margin-top: 0;
    color: var(--accent);
}

/* Lists */
ul, ol {
    margin: 1rem 0 1.5rem 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

.falsification-list {
    list-style: none;
    margin-left: 0;
}

.falsification-list li {
    padding-left: 1.5rem;
    position: relative;
}

.falsification-list li::before {
    content: "✗";
    position: absolute;
    left: 0;
    color: #c53030;
    font-weight: bold;
}

/* Contact section */
.contact-info {
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 2rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* KaTeX overrides */
.katex {
    font-size: 1.1em;
}

.katex-display {
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 1rem;
        font-size: 16px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    nav {
        gap: 0.3rem 1rem;
    }
    
    nav a {
        font-size: 0.85rem;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
}

/* Print styles */
@media print {
    nav {
        display: none;
    }
    
    body {
        max-width: none;
        padding: 0;
    }
    
    section {
        page-break-inside: avoid;
    }
    
    .equation-box {
        break-inside: avoid;
    }
}
