.toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1.8rem;
}

.toc-card {
    position: relative;
    overflow: hidden;
    padding: 1.2rem 1.4rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow-card);
    color: var(--text);
    text-decoration: none;
    will-change: transform;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.toc-card>* {
    position: relative;
    z-index: 1;
}

.toc-card h3 {
    margin-bottom: 0.35rem;
    color: var(--cream);
    font-size: 1.05rem;
    font-weight: 700;
}

.toc-card p {
    color: rgb(var(--text-rgb) / 0.9);
    font-size: 0.88rem;
    line-height: 1.45;
}

.toc-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 18%, rgb(var(--white-rgb) / 0.06), transparent 24%),
        radial-gradient(circle at 82% 82%, rgb(var(--pink-rgb) / 0.14), transparent 34%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toc-card:hover,
.toc-card:focus-visible {
    transform: translateY(-4px);
    box-shadow:
        0 18px 36px rgb(var(--black-rgb) / 0.42),
        0 0 18px rgb(var(--pink-rgb) / 0.10),
        0 0 12px rgb(var(--yellow-rgb) / 0.06);
}

.toc-card:hover,
.toc-card:focus-visible {
    transform: translateY(-4px) rotateX(1deg) rotateY(-1deg);
    box-shadow:
        var(--shadow-hover),
        0 0 14px var(--pink-50),
        0 0 10px var(--yellow-50);
}

.toc-card.active {
    border-color: var(--pink);
    box-shadow:
        0 0 0 1px var(--pink),
        0 0 14px var(--pink-75),
        0 0 10px var(--yellow-50);
}

.toc-card.highlight {
    border-color: var(--pink);
    box-shadow:
        0 0 0 1px var(--pink),
        0 0 12px var(--pink-50),
        0 0 8px var(--yellow-50);
}

.toc-heading-essential,
.toc-heading-full {
    margin-bottom: 0.6rem;
    color: var(--cream);
    font-size: 1rem;
    font-weight: 700;
}

.toc-note {
    margin-top: 0.4rem;
    margin-bottom: 1.4rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.toc-heading-full {
    margin-top: 5rem;
    margin-bottom: 0.8rem;
}

.essential-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    margin-bottom: 6rem;
    padding-bottom: 1rem;
}

.essential-grid>a:nth-child(1) {
    grid-row: 1;
    grid-column: 1;
}

.essential-grid>a:nth-child(2) {
    grid-row: 1;
    grid-column: 3;
}

.essential-grid>a:nth-child(3) {
    grid-row: 2;
    grid-column: 2;
}

.essential-grid>a:nth-child(4) {
    grid-row: 3;
    grid-column: 1;
}

.essential-grid>a:nth-child(5) {
    grid-row: 3;
    grid-column: 3;
}

.essential-grid>a,
.full-grid>a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.essential-grid>a {
    min-height: 180px;
}

.full-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: auto;
    gap: 1.2rem;
    width: 100%;
}

.full-grid>a {
    min-height: 160px;
}

#sommaire {
    position: relative;
    z-index: 2;
    display: flow-root;
    margin-top: 0.2rem;
    padding-bottom: 2.1rem;
    scroll-margin-top: var(--scroll-offset);
}

@media (max-width: 720px) {
    .essential-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.9rem;
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }

    .essential-grid>a:nth-child(1) {
        grid-row: 1;
        grid-column: 1 / span 2;
    }

    .essential-grid>a:nth-child(2) {
        grid-row: 1;
        grid-column: 3 / span 2;
    }

    .essential-grid>a:nth-child(3) {
        grid-row: 2;
        grid-column: 2 / span 2;
    }

    .essential-grid>a:nth-child(4) {
        grid-row: 3;
        grid-column: 1 / span 2;
    }

    .essential-grid>a:nth-child(5) {
        grid-row: 3;
        grid-column: 3 / span 2;
    }

    .essential-grid>a {
        min-height: 200px;
        padding: 1.05rem 0.95rem;
    }

    .essential-grid>a h3,
    .essential-grid>a p,
    .full-grid>a h3,
    .full-grid>a p {
        hyphens: none;
        -webkit-hyphens: none;
        -ms-hyphens: none;
        word-break: normal;
        overflow-wrap: break-word;
    }

    .essential-grid>a h3 {
        font-size: 0.98rem;
        line-height: 1.15;
    }

    .essential-grid>a p {
        font-size: 0.84rem;
        line-height: 1.32;
    }

    .full-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .full-grid>a {
        min-height: 190px;
        padding: 1.05rem 0.95rem;
    }
}