/* Homepage project cards, previews, and accessible search controls. */
body {
    background: #f5f7fa;
    color: #182735;
}
.section-label {
    color: #547078;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
h1 { font-weight: 600 !important; letter-spacing: -.04em; }
.project-card {
    overflow: hidden;
    border: 1px solid #e1e7eb;
    border-radius: 12px;
    background: #fff;
    color: inherit;
    transition: transform .18s ease, box-shadow .18s ease;
}
.project-card:hover, .project-card:focus {
    color: inherit;
    text-decoration: none;
    transform: translateY(-5px);
    box-shadow: 0 12px 30px #18273514;
}
.project-card:focus-visible, .personal-link a:focus-visible {
    outline: 3px solid #147b89;
    outline-offset: 4px;
}
.project-card .card-body { padding: 1.6rem; }
.project-card .card-text { line-height: 1.65; margin-bottom: 1.5rem; }
.project-link { color: #126779; font-size: .9rem; font-weight: 600; }
.project-link span { float: right; }
.project-preview { height: 180px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.preview-system { background: #e2efe6; color: #3c7758; gap: 6px; font-family: monospace; }
.preview-system span { font-size: 80px; transform: scaleY(1.3); }
.preview-system span:nth-child(2) { font-size: 120px; }
.preview-boids { background: #101f34; color: #69ddd2; gap: 12px; }
.preview-boids span { font-size: 28px; transform: rotate(-30deg); }
.preview-boids span:nth-child(2n) { align-self: flex-start; margin-top: 35px; color: #81bfff; }
.preview-boids span:nth-child(3) { margin-top: 48px; }
.preview-life { background-color: #e8e8f5; background-image: linear-gradient(#d9d9eb 1px, transparent 1px), linear-gradient(90deg, #d9d9eb 1px, transparent 1px); background-size: 24px 24px; }
.life-pattern { display: grid; grid-template-columns: repeat(3, 22px); gap: 3px; transform: rotate(-8deg); }
.life-pattern i { width: 22px; height: 22px; border-radius: 3px; }
.life-pattern i:nth-child(2), .life-pattern i:nth-child(6), .life-pattern i:nth-child(n+7) { background: #7162ac; }
.personal-link { background: #fff; border: 1px solid #e1e7eb; border-radius: 12px; gap: 16px; }
@media (max-width: 575.98px) {
    h1.display-4 { font-size: 2.5rem; }
    .project-preview { height: 150px; }
}
@media (prefers-reduced-motion: reduce) {
    .project-card { transition: none; }
    .project-card:hover, .project-card:focus { transform: none; }
}

/* Match the shared menu accent for every tile label on hover and keyboard focus. */
.project-card:hover .card-body,
.project-card:hover .card-body *,
.project-card:focus-visible .card-body,
.project-card:focus-visible .card-body * {
    color: var(--site-accent) !important;
}

/* Use the shared palette for the homepage search in both theme modes. */
.project-search input {
    background: var(--site-raised);
    border: 1px solid var(--site-border);
    color: var(--site-text);
}

.project-search input::placeholder {
    color: var(--site-muted);
}

.project-search input:focus {
    background: var(--site-raised);
    border-color: var(--site-accent);
    color: var(--site-text);
    outline: 2px solid var(--site-accent);
    outline-offset: 2px;
    box-shadow: none;
}

/* Hide entire grid columns so matching cards close up without empty gaps. */
#project-grid > article[hidden] {
    display: none !important;
}

/* Wrapping category buttons retain a visible selection and keyboard focus. */
.project-category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-category-button {
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--site-border);
    border-radius: 999px;
    background: var(--site-raised);
    color: var(--site-text);
    font: inherit;
    cursor: pointer;
}

.project-category-button:hover {
    background: var(--site-hover);
    color: var(--site-accent);
}

.project-category-button[aria-pressed="true"] {
    border-color: var(--site-accent);
    background: var(--site-accent);
    color: var(--site-bg);
}

.project-category-button:focus-visible {
    outline: 2px solid var(--site-accent);
    outline-offset: 3px;
}

/* Subtly distinguish the professional category while retaining standard interaction states. */
.project-category-button[data-category="Salesforce"]:not(:hover):not([aria-pressed="true"]) {
    border-color: color-mix(in srgb, var(--site-accent) 35%, var(--site-border));
    color: color-mix(in srgb, var(--site-accent) 30%, var(--site-text));
}
