:root {
    --cyan: #14e4f5;
    --cyan-soft: #8cecf5;
    --text: #f7f9fc;
    --muted: #d8e2ef;
    --surface: #0d172c;
    --page: #0b1020;
    --hero: #09243b;
    --border: #143957;
    --border-bright: #0d536c;
    --shadow: 0 13px 35px rgba(0, 0, 0, 0.24);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--page);
}

.site-header {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 16px 0 11px;
    background: #0e172a;
    border-bottom: 1px solid #153650;
}

.site-header a {
    text-decoration: none;
}

.site-title {
    color: var(--cyan);
    font-size: 1.45rem;
    font-weight: 700;
}

.dashboard-link {
    color: #aebfd4;
    font-size: 0.92rem;
    transition: color 160ms ease;
}

.dashboard-link:hover {
    color: var(--cyan);
}

.capsules-page {
    width: min(1300px, calc(100% - 48px));
    margin: 0 auto;
    padding: 35px 0 70px;
}

.capsules-header {
    margin-bottom: 33px;
    padding: 31px 30px 32px;
    background: var(--hero);
    border: 1px solid var(--border-bright);
    border-radius: 21px;
}

.capsules-kicker {
    display: inline-block;
    margin-bottom: 15px;
    padding: 6px 13px;
    color: var(--cyan);
    font-size: 0.88rem;
    letter-spacing: 0.04em;
    border: 1px solid #176077;
    border-radius: 999px;
}

.capsules-header h1 {
    margin: 0 0 16px;
    font-size: 2rem;
    line-height: 1.15;
}

.capsules-intro {
    max-width: 980px;
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.7;
}

.section-title {
    margin: 0 0 20px;
    font-size: 1.25rem;
    font-weight: 400;
}

.capsules-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.capsule-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.capsule-card:hover,
.capsule-card:focus-visible {
    transform: translateY(-5px);
    border-color: var(--cyan);
    box-shadow: var(--shadow);
    outline: none;
}

.capsule-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #070d18;
    border-bottom: 1px solid var(--border);
}

.capsule-thumbnail img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 250ms ease, filter 250ms ease;
}

.capsule-card:hover .capsule-thumbnail img {
    transform: scale(1.035);
    filter: brightness(0.8);
}

.capsule-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    padding-left: 4px;
    color: #fff;
    font-size: 1.45rem;
    background: rgba(5, 36, 55, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
    transform: translate(-50%, -50%);
    transition: transform 180ms ease, background 180ms ease;
}

.capsule-card:hover .capsule-play {
    color: #062331;
    background: var(--cyan);
    transform: translate(-50%, -50%) scale(1.08);
}

.capsule-duration {
    position: absolute;
    right: 10px;
    bottom: 9px;
    padding: 4px 7px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.76);
    border-radius: 5px;
}

.capsule-content {
    padding: 18px 23px 22px;
}

.capsule-category {
    display: inline-block;
    margin-bottom: 9px;
    padding: 4px 9px;
    color: var(--cyan);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #082840;
    border: 1px solid #164b66;
    border-radius: 999px;
}

.capsule-content h2 {
    margin: 0;
    color: #ffffff;
    font-size: 1.05rem;
    line-height: 1.35;
}

.capsule-content p {
    margin: 8px 0 0;
    color: #f1f5fa;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Fenêtre modale */
.video-modal {
    width: min(1000px, calc(100% - 32px));
    max-width: none;
    padding: 0;
    color: #fff;
    background: #080e19;
    border: 1px solid var(--border-bright);
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.video-modal::backdrop {
    background: rgba(2, 6, 15, 0.88);
    backdrop-filter: blur(4px);
}

.video-modal-inner {
    overflow: hidden;
    border-radius: inherit;
}

.video-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 58px;
    padding: 10px 12px 10px 20px;
}

.video-modal-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 650;
}

.video-close {
    width: 40px;
    height: 40px;
    padding: 0 0 4px;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.video-close:hover,
.video-close:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    outline: none;
}

#videoPlayer {
    width: 100%;
    max-height: calc(100vh - 130px);
    display: block;
    aspect-ratio: 16 / 9;
    background: #000;
}

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

@media (max-width: 600px) {
    .site-header {
        min-height: 56px;
        padding-inline: 12px;
    }

    .site-title {
        font-size: 1.2rem;
    }

    .dashboard-link {
        font-size: 0.8rem;
    }

    .capsules-page {
        width: min(100% - 22px, 1300px);
        padding-top: 22px;
    }

    .capsules-header {
        padding: 24px 21px;
        border-radius: 16px;
    }

    .capsules-header h1 {
        font-size: 1.65rem;
    }

    .capsules-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .video-modal {
        width: calc(100% - 18px);
    }
}
