:root {
    --brand-red: #E10600;
    /* rouge */
    --ink: #111;
    /* noir texte */
    --paper: #fffffff1;
    /* fond blanc */
    --size: clamp(320px, 70vmin, 700px);
    /* diamètre du cercle */
    --item: clamp(108px, 16vmin, 160px);
    /* taille tuile */
    --step: 60deg;
    /* 360/6 éléments */
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--paper);
    color: var(--ink);
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 24px;
}

@media (min-width: 768px) {
    body {
        /* Fond avec image centrée (sans déformation) + filtre rouge clair */
        background:
            linear-gradient(rgba(225, 7, 0, 0.093), rgba(225, 7, 0, 0.093)),
            url('../img/bonhommes_noir.png') center center / contain no-repeat,
            var(--paper);
    }
}

/* ---- MENU CIRCULAIRE ---- */
.circle {
    position: relative;
    width: var(--size);
    height: var(--size);
}

/* centre */
.center {
    position: absolute;
    inset: 0;
    margin: auto;
    width: clamp(180px, 28vmin, 260px);
    height: clamp(180px, 28vmin, 260px);
    display: grid;
    place-items: center;
    text-align: center;
    font-weight: 700;
    border-radius: 50%;
    /* Suppression du rond en trait et du fond blanc */
    border: none;
    /* Dégradé radial du centre vers l'extérieur */
    background: radial-gradient(circle at center,
            rgb(255, 255, 255) 0%,
            rgba(255, 255, 255, 0.884) 40%,
            rgba(255, 255, 255, 0) 70%,
            rgba(255, 255, 255, 0) 100%);
    z-index: 2;
    transition: transform .2s, background .2s, box-shadow .2s;

    /* >>> Animation lente (respiration) <<< */
    animation: breath 6s ease-in-out infinite 1s;
}

/* halo au survol */
.center::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--brand-red);
    opacity: 0;
    transition: opacity .3s, transform .3s;
}

.center:hover::after {
    opacity: 1;
    transform: scale(1.15);
}

.center small {
    font-weight: 500;
    opacity: .7
}

/* anneau */
.ring {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    inset: 0;
}

.ring li {
    position: absolute;
    inset: 0;
    margin: auto;
    width: var(--item);
    height: var(--item);
    transform-origin: center;
    transform: rotate(calc(var(--i)*var(--step))) translate(calc(var(--size)/2 - var(--item)/2 + 50px)) rotate(calc(-1*var(--i)*var(--step)));
    display: flex;
    align-items: center;
    justify-content: center;
}

.tile {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    border: 2px solid var(--brand-red);
    background: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
    transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;

    /* >>> Apparition lente + décalée <<< */
    opacity: 0;
    transform: translateY(10px) scale(.96);
    animation: tileIn 1.4s ease-out forwards;
}

/* stagger très lent (une par une) */
.ring li:nth-child(1) .tile {
    animation-delay: .2s
}

.ring li:nth-child(2) .tile {
    animation-delay: .6s
}

.ring li:nth-child(3) .tile {
    animation-delay: 1.0s
}

.ring li:nth-child(4) .tile {
    animation-delay: 1.4s
}

.ring li:nth-child(5) .tile {
    animation-delay: 1.8s
}

.ring li:nth-child(6) .tile {
    animation-delay: 2.2s
}

.tile:hover {
    background: var(--brand-red);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
}

.tile:focus-visible {
    outline: 3px solid rgba(225, 6, 0, .35);
    outline-offset: 3px
}

#logo {
    height: 75px;
    display: block;
    margin: 0 auto 6px;
}

a {
    text-decoration: none;
    color: #111;
}


.tile:hover {
    transition: 0.2s;
    background: var(--brand-red);
    color: #fff;
    transform: scale(1.08) translateY(-4px);
    box-shadow: 0 12px 28px rgba(225, 6, 0, .4);
}

/* animations */
@keyframes breath {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(225, 6, 0, 0);
    }

    50% {
        transform: scale(1.03);
        box-shadow: 0 0 26px rgba(225, 6, 0, .12);
    }
}

@keyframes tileIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(.94);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* accessibilité mouvement */
@media (prefers-reduced-motion: reduce) {

    .tile,
    .center {
        animation: none !important;
        transition: none !important;
    }
}

/* ---- MOBILE: pile verticale ---- */
@media (max-width:560px) {
    body {
        /* Place the hero illustration above the centered circle on mobile */
        align-items: start;
        justify-items: center;
        padding: clamp(110px, 28vw, 160px) 24px 32px;
        background:
            linear-gradient(rgba(225, 7, 0, 0.093), rgba(225, 7, 0, 0.093)),
            url('../img/bonhommes_noir.png') top center / contain no-repeat,
            var(--paper);
        background-position:
            center,
            center clamp(40px, 10vw, 70px),
            center;
    }

    :root {
        --size: 560px;
        --item: 120px;
    }

    .circle {
        width: min(520px, 92vw);
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    .ring {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
        width: 100%;
    }

    .ring li {
        position: static;
        transform: none;
        width: 100%;
        height: 100%
    }

    .tile {
        min-height: 90px
    }

    .center {
        position: static;
        width: 140px;
        height: 140px
    }

    #logo {
        height: 50px;
    }
}
