/* ------------------------------------------------------------------
   HOME SPECIFIC STYLES
   ------------------------------------------------------------------ */

.library-header {
    padding: 4rem 5vw 2rem 5vw;
    max-width: 1600px;
    margin: 0 auto;
}

h1.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 2rem;
}

.controls-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 2rem;
}

.search-container {
    position: relative;
    flex: 1;
    min-width: 280px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.4;
    width: 18px;
}

input[type="text"] {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-subtle);
    padding: 12px 12px 12px 40px;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-main);
    border-radius: 6px;
    transition: border 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

.filter-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-chip {
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 100px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s var(--ease-out);
    font-weight: 500;
}

.filter-chip:hover {
    color: var(--text-main);
    border-color: var(--text-main);
}

.filter-chip.active {
    background: var(--text-main);
    color: var(--bg-color);
    border-color: var(--text-main);
}

/* GRID */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
    padding: 2rem 5vw 6rem 5vw;
    max-width: 1600px;
    margin: 0 auto;
}

/* CARD */
.card {
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.4s var(--ease-out), border-color 0.4s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--text-muted);
    background: var(--card-hover);
}

.card-visual {
    height: 220px;
    width: 100%;
    background: var(--tag-bg);
    position: relative;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.card h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
    color: var(--text-main);
}

.icon-arrow {
    transition: transform 0.3s;
}

.card:hover .icon-arrow {
    transform: translateX(4px);
}

/* Loading / No Results */
.message-state {
    grid-column: 1 / -1;
    padding: 4rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    opacity: 0.5;
}

@media(max-width: 768px) {
    .library-header {
        padding-top: 2rem;
    }

    h1.hero-title {
        margin-bottom: 1.5rem;
    }

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

    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* FOOTER */
.main-footer {
    padding: 4rem 5vw;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
    margin-top: 4rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.main-footer a {
    color: var(--text-main);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 4px;
    font-weight: 500;
    transition: color 0.2s;
}

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