/* AI Evals Handbook - Educational Documentation Style */

:root {
    /* Light, readable palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-code: #1e293b;
    --bg-code-light: #f8fafc;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-code: #e2e8f0;

    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-bg: #eef2ff;
    --accent-border: #c7d2fe;

    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --error: #ef4444;
    --error-bg: #fef2f2;

    --border: #e2e8f0;
    --border-dark: #cbd5e1;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-serif: 'Georgia', 'Times New Roman', serif;

    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.15s ease;

    --content-width: 720px;
    --sidebar-width: 260px;
}

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

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.025em;
}

h2 {
    font-size: 1.875rem;
    letter-spacing: -0.02em;
}

h3 {
    font-size: 1.375rem;
}

h4 {
    font-size: 1.125rem;
}

p {
    color: var(--text-secondary);
    line-height: 1.8;
}

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

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

/* Navigation - Minimal, documentation style */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    text-decoration: none;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-links a {
    display: block;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.nav-github {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.nav-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
}

/* Hero - Clean, focused */
.hero {
    padding: 100px 0 80px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border);
}

.hero .container {
    max-width: 800px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 24px;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 50%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.8;
}

.hero-quote {
    max-width: 500px;
    margin: 0 auto 40px;
    padding: 20px 24px;
    background: var(--bg-primary);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: var(--shadow-sm);
}

.hero-quote blockquote {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

.hero-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-bg {
    display: none;
}

:root {
    --content-width: 100%;
    --sidebar-width: 0px;
}

.container {
    padding: 0 16px;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

/* Navigation */
.nav-links {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    flex-direction: column;
    padding: 24px;
    border-bottom: none;
    z-index: 999;
    overflow-y: auto;
}

.nav-links.active {
    display: flex;
}

.nav-toggle {
    display: flex;
}

/* Hero */
.hero {
    padding: 60px 0 40px;
}

.hero-title {
    font-size: 2.25rem;
}

/* Grids */
.frameworks-grid,
.case-studies-grid,
.problem-grid,
.code-cards {
    grid-template-columns: 1fr;
}

/* Framework Page */
.content-grid {
    grid-template-columns: 1fr;
}

.toc {
    display: none;
    /* Hide TOC on mobile for now, or move to bottom/collapse */
}

/* Docs Sidebar Fixes */
.docs-sidebar {
    top: 64px;
    height: calc(100vh - 64px);
}

.docs-main {
    padding: 24px 16px;
}

/* Header adjustments */
.docs-header .container {
    padding: 0 16px;
}
}

/* Mobile Sidebar Toggle Button (injected via JS) */
.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    margin-right: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    background: transparent;
    border: none;
}

.sidebar-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
    }
}

/* Mobile Menu Open State */
body.mobile-menu-open {
    overflow: hidden;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--border-dark);
    color: var(--text-primary);
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-alt {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 48px;
}

.section-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-bg);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.section-header h2 {
    margin-bottom: 12px;
}

.section-header p {
    font-size: 1.05rem;
}

/* Problem Cards - Clean, informative */
.problem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.problem-card {
    padding: 28px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.problem-card:hover {
    border-color: var(--border-dark);
    box-shadow: var(--shadow-md);
}

.problem-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin-bottom: 16px;
}

.problem-icon.wrong {
    background: var(--error-bg);
    color: var(--error);
}

.problem-icon svg {
    width: 22px;
    height: 22px;
}

.problem-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.problem-card p {
    font-size: 0.925rem;
    line-height: 1.7;
}

/* Solution Box */
.solution-intro {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 28px;
    background: var(--success-bg);
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-lg);
}

.solution-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--success);
    border-radius: 12px;
    color: white;
}

.solution-icon svg {
    width: 24px;
    height: 24px;
}

.solution-intro h3 {
    font-size: 1.125rem;
    margin-bottom: 8px;
    color: #065f46;
}

.solution-intro p {
    color: #047857;
    font-size: 0.95rem;
}

/* Framework Cards - Documentation style */
.frameworks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
}

.framework-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    position: relative;
}

.framework-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.framework-number {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
    font-family: var(--font-mono);
}

.framework-card h3 {
    font-size: 1.125rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.framework-card p {
    font-size: 0.9rem;
    margin-bottom: 16px;
    flex-grow: 1;
}

.framework-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.framework-tags span {
    padding: 4px 10px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.framework-arrow {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 50%;
    color: var(--text-muted);
    transition: var(--transition);
}

.framework-card:hover .framework-arrow {
    background: var(--accent);
    color: white;
}

.framework-arrow svg {
    width: 16px;
    height: 16px;
}

/* Interactive Demo */
.demo-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.demo-panel {
    padding: 28px;
}

.demo-panel:first-child {
    border-right: 1px solid var(--border);
}

.demo-panel h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.demo-scenarios {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.demo-scenario {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.scenario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.scenario-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.scenario-domain {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 2px 8px;
    background: var(--bg-primary);
    border-radius: 4px;
}

.demo-scenario>p {
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.scenario-metrics {
    display: flex;
    gap: 24px;
}

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

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

.metric-value {
    font-weight: 600;
    font-size: 0.85rem;
}

.metric-value.low {
    color: var(--success);
}

.metric-value.high {
    color: var(--error);
}

/* Comparison Bars */
.comparison {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.comparison-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comparison-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.comparison-bar {
    height: 36px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--accent);
    display: flex;
    align-items: center;
    padding-left: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
    transition: width 1s ease;
}

.comparison-row.highlight .comparison-bar {
    border: 2px solid var(--error);
}

.comparison-row.highlight .bar-fill {
    background: var(--error);
}

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

.demo-insight {
    padding: 14px 16px;
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.demo-insight strong {
    color: var(--accent);
}

/* Case Studies */
.case-studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.case-study-card {
    display: block;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.case-study-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.case-study-image {
    height: 140px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
}

.case-study-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-bg);
    border-radius: 14px;
    color: var(--accent);
}

.case-study-icon svg {
    width: 28px;
    height: 28px;
}

.case-study-content {
    padding: 20px;
}

.case-study-tag {
    display: inline-block;
    padding: 3px 8px;
    background: var(--accent-bg);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.case-study-content h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.case-study-content>p {
    font-size: 0.875rem;
    margin-bottom: 14px;
    line-height: 1.6;
}

.case-study-meta {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Code Section */
.code-preview {
    background: var(--bg-code);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #0f172a;
    border-bottom: 1px solid #334155;
}

.code-filename {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #94a3b8;
}

.code-link {
    font-size: 0.8rem;
    color: var(--accent-light);
    text-decoration: none;
}

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

.code-preview pre {
    padding: 24px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.7;
    margin: 0;
}

.code-preview code {
    color: #e2e8f0;
}

.code-preview .keyword {
    color: #c084fc;
}

.code-preview .string {
    color: #86efac;
}

.code-preview .number {
    color: #fcd34d;
}

.code-preview .comment {
    color: #64748b;
    font-style: italic;
}

.code-preview .function {
    color: #7dd3fc;
}

.code-preview .class-name {
    color: #fcd34d;
}

/* Code Cards */
.code-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.code-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.code-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.code-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 8px;
    color: var(--accent);
    flex-shrink: 0;
}

.code-card-icon svg {
    width: 20px;
    height: 20px;
}

.code-card h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.code-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

/* About Section */
.about-content {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.about-text h2 {
    font-size: 1.75rem;
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 14px;
    font-size: 1rem;
}

.about-links {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 28px;
}

.about-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.about-link:hover {
    color: var(--accent);
}

/* Footer */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

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

.footer-content p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-content a {
    color: var(--text-secondary);
}

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

.footer-note {
    margin-top: 6px;
    font-size: 0.8rem !important;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .demo-container {
        grid-template-columns: 1fr;
    }

    .demo-panel:first-child {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .solution-intro {
        flex-direction: column;
    }

    .frameworks-grid,
    .case-studies-grid {
        grid-template-columns: 1fr;
    }
}

/* Featured Tweet in Hero */
.featured-tweet {
    max-width: 600px;
    margin: 0 auto 40px;
    padding: 0;
    background: transparent;
    border-left: none;
    box-shadow: none;
}

.featured-tweet .tweet-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.featured-tweet .tweet-attribution {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}

.featured-tweet .tweet-attribution strong {
    color: var(--text-primary);
}

@media (max-width: 640px) {
    .featured-tweet .tweet-image {
        max-width: 100%;
    }
}