/* Optimized CSS for SWE-Perf - Inspired by GSO's minimal approach */

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

/* CSS Variables */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent-primary: #FF2B54;
    --accent-hover: #e21947;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
}

/* Typography with optimized font loading */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Navigation - Simplified like GSO */
.main-nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--accent-primary);
    background: #fff1f3;
}

.nav-link.active {
    color: var(--accent-primary);
    background: #ffe4e8;
    font-weight: 600;
}

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

.hero {
    padding: 2rem 0 1.5rem;
    text-align: center;
    background: var(--bg-secondary);
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

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

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Sections */
.section {
    padding: 1.5rem 0;
    background-color: var(--bg-secondary);
}

.section-light-bg {
    background-color: var(--bg-primary);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
    color: var(--text-primary);
}

h2 {
    font-size: 2.25rem;
    font-weight: 700;
    border-bottom: 3px solid var(--accent-primary);
    padding-bottom: 0.5rem;
    display: inline-block;
    margin-bottom: 2rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Buttons */
.btn, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    min-height: 48px;
    cursor: pointer;
}

.btn-primary, .button.is-dark {
    background-color: var(--text-primary);
    color: var(--bg-secondary);
}

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

/* Links */
a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 8px 16px -4px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    padding: 2rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.highlight-text {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Code blocks */
pre, code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

pre {
    padding: 1.5rem;
    overflow-x: auto;
}

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

/* Responsive */
@media (max-width: 768px) {
    body { font-size: 16px; }
    .container { padding: 0 1rem; }
    .nav-container { flex-direction: column; gap: 1rem; }
    .hero-title { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    .nav-links { gap: 1rem; }
    .nav-link { font-size: 1rem; padding: 0.5rem 0.75rem; }
}

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Performance optimizations */
.hero-logo {
    max-width: 800px;
    width: 100%;
    margin: 0 auto 0 auto;
}

/* Reduce repaints */
.publication-links {
    will-change: transform;
}

/* Optimize animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}