:root {
    color-scheme: light dark;
    --font-body: 'Roboto', 'Segoe UI', sans-serif;
    --font-heading: 'Roboto', 'Segoe UI', sans-serif;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --space-2: 8px;
    --space-3: 10px;
    --space-4: 12px;
    --space-5: 16px;
    --space-6: 20px;
    --space-7: 24px;
    --space-8: 32px;
    --space-9: 48px;
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
}

[data-theme="light"] {
    --bg-1: #f9fafb;
    --bg-2: #f3f4f6;
    --surface: #ffffff;
    --surface-hover: #f9fafb;
    --border: #e5e7eb;
    --border-hover: #d1d5db;
    --text: #111827;
    --text-muted: #6b7280;
    --accent: #006000;
    --accent-soft: #ccdfcc;
    --accent-text: #006000;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --bg-1: #111827;
    --bg-2: #1f2937;
    --surface: #1f2937;
    --surface-hover: #374151;
    --border: #374151;
    --border-hover: #4b5563;
    --text: #f9fafb;
    --text-muted: #9ca3af;
    --accent: #338033;
    --accent-soft: rgba(0, 96, 0, 0.2);
    --accent-text: #66a066;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.4);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    transition:
        background-color var(--transition-base),
        color var(--transition-base),
        border-color var(--transition-base),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background-color: var(--bg-1);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    margin: 0;
    line-height: 1.25;
}

p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ── Shell ── */
.labs-shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
}

/* ── Header ── */
.labs-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-6);
    margin-bottom: var(--space-9);
}

.labs-header__title {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.labs-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 1px solid var(--border);
}

.labs-kicker {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 4px;
}

.labs-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.labs-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
    max-width: 640px;
    line-height: 1.5;
}

/* ── Grid ── */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-9);
}

/* ── Theme toggle ── */
.labs-theme-toggle {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px;
    flex-shrink: 0;
}

.labs-theme-toggle button {
    all: unset;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    color: var(--text-muted);
}

.labs-theme-toggle button.is-active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* ── Card ── */
.project-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-7);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.project-card:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-hover);
}

.project-card__icon {
    font-size: 20px;
    margin-bottom: var(--space-4);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--accent);
}

.project-card__name {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: var(--space-2);
    letter-spacing: -0.01em;
}

.project-card__desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.55;
    flex: 1;
    margin-bottom: var(--space-5);
}

.project-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.project-card__badge {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 2px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--accent-soft);
    color: var(--accent-text);
    border: 1px solid currentColor;
    opacity: 0.85;
}

.project-card__action {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-card:hover .project-card__action {
    color: var(--accent);
}

/* ── Contribute banner ── */
.contribute-banner {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-7);
    margin-bottom: var(--space-8);
    box-shadow: var(--shadow);
}

.contribute-banner__icon {
    font-size: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--accent);
    flex-shrink: 0;
}

.contribute-banner__body {
    flex: 1;
}

.contribute-banner__title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.contribute-banner__desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.55;
}

.contribute-banner__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 7px 16px;
    flex-shrink: 0;
    white-space: nowrap;
    text-decoration: none;
}

.contribute-banner__link:hover {
    opacity: 0.9;
}

/* ── Footer ── */
.labs-footer {
    text-align: center;
    padding: var(--space-9) 0 var(--space-8);
    font-size: 12px;
    color: var(--text-muted);
}

.labs-footer a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
