/* ===== CSS Variables ===== */
:root {
    --primary: #2c5282;
    --primary-light: #4299e1;
    --primary-dark: #1a365d;
    --accent: #ed8936;
    --accent-light: #fbb6ce;
    
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-alt: #edf2f7;
    
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    
    --transition: all 0.3s ease;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f7fafc;
        --text-secondary: #cbd5e0;
        --text-muted: #a0aec0;
        
        --bg-primary: #1a202c;
        --bg-secondary: #2d3748;
        --bg-alt: #252d3d;
        
        --border-color: #4a5568;
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
    }
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 600;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-secondary);
}

code {
    font-family: var(--font-mono);
    background: var(--bg-alt);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

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

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

@media (prefers-color-scheme: dark) {
    .navbar {
        background: rgba(26, 32, 44, 0.95);
    }
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary);
}

.logo {
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

/* ===== Hero ===== */
.hero {
    padding: 8rem 0 6rem;
    margin-top: 4rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.tagline {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.motto {
    font-style: italic;
    color: var(--text-muted);
    margin: 2rem 0;
    font-size: 1.1rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

.btn-link {
    background: transparent;
    color: var(--primary);
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
}

.btn-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== Sections ===== */
.section {
    padding: 5rem 0;
}

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

.section-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* ===== Insight Cards ===== */
.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.insight-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.insight-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.visual-placeholder {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ===== Principle Section ===== */
.principle-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.formula {
    background: var(--bg-alt);
    padding: 1.5rem;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    text-align: center;
    margin: 2rem 0;
    border-left: 4px solid var(--accent);
}

.benefits-list {
    list-style: none;
    margin-top: 1.5rem;
}

.benefits-list li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.benefits-list li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

.delay-diagram {
    background: var(--bg-alt);
    padding: 2rem;
    border-radius: 8px;
}

.timeline {
    height: 80px;
    background: linear-gradient(to right, var(--primary-light), var(--accent));
    border-radius: 40px;
    position: relative;
    margin-bottom: 1rem;
}

.time-marker {
    position: absolute;
    top: -30px;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.time-marker:after {
    content: "";
    position: absolute;
    width: 2px;
    height: 40px;
    background: var(--text-muted);
    left: 50%;
    top: 20px;
}

.caption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ===== Comparison Table ===== */
.comparison-table {
    overflow-x: auto;
    margin-top: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

thead {
    background: var(--primary);
    color: white;
}

th, td {
    padding: 1rem;
    text-align: left;
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
}

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

tbody tr:hover {
    background: var(--bg-alt);
}

/* ===== Results Grid ===== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.result-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    border-top: 4px solid var(--accent);
}

.metric {
    display: flex;
    flex-direction: column;
    margin: 1.5rem 0;
}

.metric-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.metric-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.findings {
    list-style: none;
    margin-top: 1rem;
}

.findings li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.findings li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

.key-finding {
    margin-top: 4rem;
    padding: 2rem;
    background: var(--bg-alt);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

/* ===== Paper Section ===== */
.paper-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.paper-meta {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.paper-abstract {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.paper-actions {
    display: flex;
    gap: 1rem;
}

.paper-highlights h4 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.paper-highlights ul {
    list-style: none;
}

.paper-highlights li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.paper-highlights li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--accent);
}

.citation {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.citation h4 {
    margin-bottom: 1rem;
}

.citation code {
    display: block;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ===== Resources Grid ===== */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.resource-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.resource-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.link-list {
    list-style: none;
    margin-top: 1rem;
}

.link-list li {
    padding: 0.5rem 0;
}

.link-list a {
    color: var(--primary);
    text-decoration: none;
}

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

/* ===== About Section ===== */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.contact {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.contact a {
    color: var(--primary);
    text-decoration: none;
}

.contact a:hover {
    text-decoration: underline;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-alt);
    padding: 3rem 0 1rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .nav-links {
        position: fixed;
        top: 60px;
        right: -100%;
        flex-direction: column;
        background: var(--bg-primary);
        width: 250px;
        padding: 2rem;
        box-shadow: var(--shadow-lg);
        transition: right 0.3s ease;
        gap: 1rem;
        font-size: 0.9rem;
        border-left: 1px solid var(--border-color);
    }
    
    .nav-links.mobile-active {
        right: 0;
    }
    
    .menu-toggle {
        display: block !important;
    }
    
    .hero {
        padding: 6rem 0 4rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .principle-content,
    .paper-content {
        grid-template-columns: 1fr;
    }
    
    .insight-grid,
    .results-grid,
    .resources-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content,
.insight-card,
.result-card,
.resource-card {
    animation: fadeInUp 0.6s ease-out;
}
