* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    padding: 28px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.title {
    font-weight: 800;
    font-size: 20px;
}

.sub {
    color: var(--muted, rgba(255,255,255,0.72));
    font-size: 14px;
}

/* grid: max 3 columns */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 920px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    transition: transform .12s ease, box-shadow .12s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(2,6,23,0.6);
}

.thumb {
    height: 140px;
    background: linear-gradient(135deg, #06b6d4, #60a5fa);
    display: block;
}

/* ensure images inserted into .thumb only fill the thumb area */
.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.proj-title {
    font-weight: 800;
    font-size: 15px;
}

.proj-desc {
    color: var(--muted, rgba(255,255,255,0.72));
    font-size: 13px;
}

.tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.tag {
    font-size: 12px;
    padding: 6px 8px;
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
}

.tag.dev {
    background: #2563eb;
}

.tag.design {
    background: #ef7b72;
}

.tag.research {
    background: #8b5cf6;
}

.tag.frontend {
    background: #06b6d4;
}

/* list view overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(2,6,23,0.6), rgba(2,6,23,0.9));
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.overlay-inner {
    width: 100%;
    max-width: 880px;
    background: linear-gradient(180deg, #071027, #071a2a);
    border-radius: 12px;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.06);
    max-height: 90vh;
    overflow: auto;
}

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

.close-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--font-white, #ffffff);
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
    border: 1px solid rgba(255,255,255,0.03);
}

.list-thumb {
    width: 120px;
    height: 70px;
    border-radius: 8px;
    background: linear-gradient(135deg, #60a5fa, #06b6d4);
    flex: 0 0 120px;
}

.list-body {
    flex: 1;
}

/* small icon button */
.list-toggle {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    display: inline-grid;
    place-items: center;
    color: var(--accent, #2dd4bf);
    border: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
}

/* accessibility focus */
.list-toggle:focus, .close-btn:focus {
    outline: 3px solid rgba(45,212,191,0.16);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .card {
        transition: none;
    }
}
