.homepage-videos {
    --video-surface: oklch(99% 0.004 225);
    --video-surface-muted: oklch(96% 0.009 225);
    --video-border: oklch(88% 0.012 225);
    --video-border-strong: oklch(75% 0.02 225);
    --video-text: oklch(23% 0.018 225);
    --video-muted: oklch(49% 0.018 225);
    --video-faint: oklch(66% 0.015 225);
    --video-accent: oklch(43% 0.105 235);
    --video-accent-soft: oklch(94% 0.028 235);
    --space-2xs: 0.25rem;
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    padding-inline: clamp(1rem, 4vw, 2rem);
    color: var(--video-text);
}

.videos-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.videos-title {
    margin: 0;
    color: var(--video-text);
    font-size: 1.5rem;
    font-weight: 650;
    line-height: 1.15;
    text-wrap: balance;
}

.videos-view-all {
    min-block-size: 44px;
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--video-accent);
    font-size: 0.875rem;
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition:
        color 180ms ease,
        transform 180ms ease;
}

.videos-view-all:hover {
    color: var(--video-text);
    transform: translateX(2px);
}

.videos-view-all:focus-visible {
    outline: 2px solid var(--video-accent);
    outline-offset: 4px;
    border-radius: 4px;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-md);
}

.video-card {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    background: var(--video-surface);
    border: 1px solid var(--video-border);
    border-radius: 8px;
    transition:
        border-color 180ms ease,
        transform 180ms ease,
        box-shadow 180ms ease;
    contain: layout paint;
}

.video-card:focus-within {
    border-color: var(--video-accent);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--video-accent) 18%, transparent);
}

.video-card__thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background:
        linear-gradient(135deg, transparent 0 48%, color-mix(in oklch, var(--video-accent) 9%, transparent) 48% 52%, transparent 52%),
        var(--video-surface-muted);
}

.video-card__thumb--vimeo {
    aspect-ratio: 16 / 8.75;
}

.video-card__thumb > :not(.video-card__unavailable) {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.video-card__thumb iframe,
.video-card__thumb video,
.video-card__thumb embed,
.video-card__thumb object {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

.video-card__unavailable {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: var(--space-md);
    color: var(--video-muted);
    font-size: 0.875rem;
    line-height: 1.4;
    text-align: center;
}

.video-card__duration {
    position: absolute;
    right: var(--space-xs);
    bottom: var(--space-xs);
    border-radius: 4px;
    background: oklch(24% 0.018 225 / 0.82);
    color: oklch(97% 0.006 225);
    font-size: 0.75rem;
    font-weight: 650;
    line-height: 1;
    padding: 0.25rem 0.5rem;
}

.video-card__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-md);
}

.video-card__category {
    width: fit-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding: 0.1875rem 0.5rem;
    border-radius: 4px;
    background: var(--video-accent-soft);
    color: var(--video-accent);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.video-card__title {
    margin: 0;
    color: var(--video-text);
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.35;
    text-wrap: pretty;
}

.video-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: auto;
    color: var(--video-muted);
    font-size: 0.875rem;
    line-height: 1.35;
}

.video-card__date {
    color: var(--video-text);
    font-weight: 600;
}

.video-card__meta-sep {
    width: 0.25rem;
    height: 0.25rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--video-faint);
}

.videos-footer {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--video-border);
}

.videos-footer-label {
    color: var(--video-muted);
    font-size: 0.875rem;
    line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
    .videos-view-all,
    .video-card {
        transition: none;
    }

    .videos-view-all:hover,
    .video-card:hover {
        transform: none;
    }
}

@media (max-width: 900px) {
    .videos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .homepage-videos {
        padding-inline: 1rem;
    }

    .videos-header {
        align-items: start;
        flex-direction: column;
        gap: var(--space-sm);
    }

    .videos-grid {
        grid-template-columns: 1fr;
    }

    .videos-title {
        font-size: 1.375rem;
    }
}
