/* Reset and base */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --color-bg: #0f0f0f;
    --color-surface: #1a1a1a;
    --color-surface-hover: #252525;
    --color-border: #333;
    --color-text: #e0e0e0;
    --color-text-muted: #888;
    --color-accent: #4A90D9;
    --color-accent-light: #6BA3E0;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Header */
header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 2rem;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-text);
}

header .subtitle {
    margin: 0.5rem 0 0;
    color: var(--color-text-muted);
    font-size: 1rem;
}

/* Main content */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    margin-bottom: 3rem;
}

section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

@media (min-width: 1000px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 700px) and (max-width: 999px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Graph Cards */
.card {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--color-accent);
}

.card-preview {
    aspect-ratio: 4/3;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1rem;
}

.card-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card-content {
    padding: 1rem;
}

.card-content h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-accent-light);
}

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

/* Findings Grid */
.findings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

@media (min-width: 1000px) {
    .findings-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.finding-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.finding-card h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-accent-light);
}

.finding-card p,
.finding-card ul {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
}

.finding-card ul {
    padding-left: 1.25rem;
}

.finding-card li {
    margin-bottom: 0.25rem;
}

.finding-card code {
    background: #2a2a2a;
    padding: 0.1em 0.4em;
    border-radius: 3px;
    font-size: 0.85em;
    color: #f0f0f0;
}

.finding-card pre {
    background: var(--color-bg);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

/* Tech Stack Grid */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

@media (min-width: 700px) {
    .tech-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.tech-column {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.tech-column h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-accent-light);
}

.tech-column ul {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
}

.tech-column li {
    margin-bottom: 0.25rem;
}

/* Graph Section */
.graph-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 2rem;
    overflow: hidden;
}

.graph-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.graph-header-row h2 {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 1.25rem;
}

.view-btn {
    background: var(--color-accent);
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.view-btn:hover {
    background: var(--color-accent-light);
}

.graph-section .graph-preview {
    display: block;
    background: #fff;
    max-height: 400px;
    overflow: hidden;
}

.graph-section .graph-preview img {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: top left;
}

.graph-details {
    padding: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.graph-details p {
    margin: 0 0 1rem;
    color: var(--color-text-muted);
}

.graph-details h4 {
    margin: 1.5rem 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-accent-light);
}

.graph-details h4:first-child {
    margin-top: 0;
}

.graph-details ul {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.9rem;
}

.graph-details li {
    margin-bottom: 0.35rem;
}

.graph-details code {
    background: #2a2a2a;
    padding: 0.1em 0.4em;
    border-radius: 3px;
    font-size: 0.85em;
}

/* Footer */
footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

footer p {
    margin: 0.25rem 0;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    main {
        padding: 1rem;
    }

    header {
        padding: 1.5rem 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .card-grid,
    .findings-grid {
        grid-template-columns: 1fr;
    }
}
