*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::-webkit-scrollbar {
    width: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
    background: #000;
    color: #fff;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ——— Toolbar ——— */

.toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
}

.toolbar__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toolbar__start {
    flex: 1;
    display: flex;
}

.toolbar__center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.toolbar__end {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.toolbar__avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #1c1c1e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: background 0.2s;
}

.toolbar__avatar:hover {
    background: #2c2c2e;
}

.toolbar__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.02em;
}

/* ——— Segmented Control ——— */

.segmented {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 2px;
}

.segmented__item {
    padding: 5px 14px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
    white-space: nowrap;
}

.segmented__item:hover {
    color: rgba(255, 255, 255, 0.9);
}

.segmented__item.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ——— Grid ——— */

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px 80px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* ——— Card ——— */

.card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #111;
    cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.card:active {
    transform: scale(0.98);
}

.card__media {
    position: relative;
    aspect-ratio: 1;
    background: #1a1a1a;
    overflow: hidden;
}

.card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card:hover .card__media img {
    transform: scale(1.06);
}

.card__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover .card__play {
    opacity: 1;
}

.card__play-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: scale(0.85);
}

.card:hover .card__play-icon {
    transform: scale(1);
}

.card__play-icon i {
    font-size: 1rem;
    color: #fff;
    margin-left: 2px;
}

.card__body {
    padding: 14px 16px 16px;
}

.card__title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.card__channel {
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
}

.card__date {
    font-size: 0.68rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

/* ——— Empty ——— */

.empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 0;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ——— Footer ——— */

footer {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.12);
    font-size: 0.78rem;
    font-weight: 500;
}

/* ——— Responsive ——— */

@media (max-width: 768px) {
    .toolbar__title {
        display: none;
    }

    .toolbar__end {
        flex: 2;
    }

    .segmented {
        border-radius: 10px;
        padding: 3px;
    }

    .segmented__item {
        padding: 6px 12px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .toolbar__center {
        display: none;
    }

    .toolbar__end {
        flex: 1;
    }

    .toolbar__inner {
        padding: 0 14px;
    }

    main {
        padding: 20px 14px 60px;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .card {
        border-radius: 10px;
    }

    .card__body {
        padding: 10px 12px 12px;
    }

    .card__title {
        font-size: 0.75rem;
    }

    .card__channel {
        font-size: 0.68rem;
    }

    .card__date {
        font-size: 0.65rem;
    }
}
