/* =========================================================
   Page d'accueil
   ========================================================= */

/* ---------- En-tête ---------- */

.entete {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.entete--plein {
    background: rgb(var(--nuit-rvb) / 0.92);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 var(--ligne);
}

.entete__barre {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
}

.menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.menu a:not(.bouton) {
    position: relative;
    padding: 10px 14px;
    font-weight: 500;
    color: var(--texte-2);
    text-decoration: none;
    transition: color 0.2s ease;
}

.menu a:not(.bouton)::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 4px;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.menu a:not(.bouton):hover,
.menu a.actif {
    color: var(--texte);
}

.menu a:not(.bouton):hover::after,
.menu a.actif::after {
    transform: scaleX(1);
}

.bouton--petit {
    --biseau: 10px;
    min-height: 42px;
    padding: 8px 20px;
    margin-left: 12px;
    font-size: 0.98rem;
}

.menu-bouton {
    display: none;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--texte);
    cursor: pointer;
}

.menu-bouton__barres,
.menu-bouton__barres::before,
.menu-bouton__barres::after {
    display: block;
    width: 24px;
    height: 2px;
    margin: auto;
    background: currentColor;
    transition: transform 0.25s ease;
}

.menu-bouton__barres {
    position: relative;
}

.menu-bouton__barres::before,
.menu-bouton__barres::after {
    content: "";
    position: absolute;
    left: 0;
}

.menu-bouton__barres::before { top: -7px; }
.menu-bouton__barres::after { top: 7px; }

.menu-bouton[aria-expanded="true"] .menu-bouton__barres {
    background: transparent;
}

.menu-bouton[aria-expanded="true"] .menu-bouton__barres::before {
    transform: translateY(7px) rotate(45deg);
}

.menu-bouton[aria-expanded="true"] .menu-bouton__barres::after {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero vidéo ---------- */

.hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: min(100svh, 860px);
    padding: 120px 0 clamp(56px, 9vh, 96px);
    overflow: hidden;
    background: var(--nuit) url(../imgs/web/poster.webp) center / cover;
}

.hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero__voile {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, var(--nuit) 0%, rgb(var(--nuit-rvb) / 0.55) 40%, rgb(var(--nuit-rvb) / 0.1) 70%, rgb(var(--nuit-rvb) / 0.6) 100%),
        linear-gradient(to right, rgb(var(--nuit-rvb) / 0.7) 0%, rgb(var(--nuit-rvb) / 0) 65%);
}

.hero__contenu {
    position: relative;
}

.hero__titre {
    display: flex;
    flex-direction: column;
    font-size: clamp(2.6rem, 7vw, 5.6rem);
    line-height: 0.98;
    letter-spacing: -0.025em;
}

/* Les trois lignes du titre reprennent les couleurs du duel */
.hero__titre span:nth-child(1) { color: var(--def); }
.hero__titre span:nth-child(3) { color: var(--att); }

.hero__texte {
    max-width: 46ch;
    margin-top: 24px;
    font-size: clamp(1.1rem, 1.6vw, 1.3rem);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

/* Une seule séquence d'entrée, au chargement */
.hero__titre span,
.hero__texte,
.hero__actions {
    animation: entree 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.hero__titre span:nth-child(2) { animation-delay: 0.12s; }
.hero__titre span:nth-child(3) { animation-delay: 0.24s; }
.hero__texte { animation-delay: 0.4s; }
.hero__actions { animation-delay: 0.5s; }

@keyframes entree {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
}

.hero__controles {
    position: absolute;
    right: var(--marge);
    bottom: 24px;
    display: flex;
    gap: 8px;
}

.controle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgb(var(--texte-rvb) / 0.35);
    border-radius: 50%;
    background: rgb(var(--nuit-rvb) / 0.55);
    color: var(--texte);
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background-color 0.2s ease;
}

.controle:hover {
    background: rgb(var(--nuit-rvb) / 0.85);
}

.controle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.icone-lecture,
.icone-son,
.en-pause .icone-pause,
.son-actif .icone-muet {
    display: none;
}

.en-pause .icone-lecture,
.son-actif .icone-son {
    display: block;
}

/* ---------- Repères ---------- */

.reperes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 8px;
    margin-bottom: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--ligne);
    border-bottom: 1px solid var(--ligne);
}

.reperes li {
    padding: 22px 20px;
    color: var(--texte-2);
    line-height: 1.35;
}

.reperes li + li {
    border-left: 1px solid var(--ligne);
}

.reperes strong {
    display: block;
    font-family: var(--titre);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--texte);
    margin-bottom: 4px;
}

.reperes__prix strong {
    color: var(--or);
}

/* ---------- Sections ---------- */

.section {
    padding-block: clamp(64px, 9vw, 112px) 0;
}

.section__titre {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 28px;
}

.intro__texte {
    max-width: 68ch;
    font-size: clamp(1.15rem, 1.7vw, 1.35rem);
    color: var(--texte-2);
}

/* ---------- Le duel des factions ---------- */

.factions {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: clamp(64px, 9vw, 112px);
    min-height: 620px;
    isolation: isolate;
}

.faction {
    position: relative;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

/* La ligne de front : une coupe en diagonale entre les deux camps */
.faction--def {
    clip-path: polygon(0 0, 100% 0, calc(100% - 70px) 100%, 0 100%);
    margin-right: -36px;
}

.faction--att {
    clip-path: polygon(70px 0, 100% 0, 100% 100%, 0 100%);
    margin-left: -36px;
}

.faction__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.faction:hover .faction__image {
    transform: scale(1.04);
}

.faction--def .faction__image { object-position: 55% 30%; }
.faction--att .faction__image { object-position: 45% 30%; }

.faction--def { --voile-rvb: 6 22 48; }
.faction--att { --voile-rvb: 40 6 8; }

/* Voile sombre teinté aux couleurs du camp, pour lire le texte sur l'image */
.faction::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top,
        rgb(var(--voile-rvb) / 0.96) 0%,
        rgb(var(--voile-rvb) / 0.75) 42%,
        rgb(var(--voile-rvb) / 0.1) 75%);
}

.faction__contenu {
    position: relative;
    z-index: 2;
    max-width: 520px;
    padding: 48px clamp(24px, 4vw, 64px) 56px;
}

.faction--def .faction__contenu {
    padding-right: 110px;
}

.faction--att .faction__contenu {
    margin-left: auto;
    padding-left: 110px;
    text-align: right;
}

.faction h3 {
    font-size: clamp(2rem, 3.6vw, 2.9rem);
    margin-bottom: 14px;
}

.faction--def h3 { color: var(--def); }
.faction--att h3 { color: var(--att); }

.faction p {
    margin-bottom: 28px;
}

.factions__vs {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    transform: translate(-50%, -50%) rotate(45deg);
    background: var(--nuit);
    box-shadow: 0 0 0 2px var(--texte);
    font-family: var(--titre);
    font-size: 1.5rem;
    font-weight: 700;
}

/* Le texte « VS » reste droit dans le losange */
.factions__vs span {
    transform: rotate(-45deg);
}

/* ---------- Sur le terrain ---------- */

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

.carte {
    display: flex;
    flex-direction: column;
    background: var(--acier);
    --biseau: 22px;
}

.carte img {
    width: 100%;
    aspect-ratio: 16 / 8;
    object-fit: cover;
}

.carte__texte {
    padding: 24px 28px 32px;
}

.carte h3 {
    font-size: 1.6rem;
    margin-bottom: 10px;
}

.carte p {
    color: var(--texte-2);
}

.carte--trophee {
    background: linear-gradient(160deg, #3a2e14 0%, var(--acier) 55%);
}

.carte--trophee h3,
.carte--trophee strong {
    color: var(--or);
}

/* ---------- Règlement ---------- */

.reglement {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 56px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: article;
}

.reglement li {
    counter-increment: article;
    display: grid;
    grid-template-columns: 64px 1fr;
    align-content: start;
    column-gap: 8px;
    padding: 24px 0;
    border-top: 1px solid var(--ligne);
}

.reglement li::before {
    content: "Art. " counter(article);
    grid-row: span 2;
    padding-top: 4px;
    font-family: var(--titre);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--texte-2);
}

.reglement h3 {
    font-size: 1.3rem;
    margin-bottom: 6px;
}

.reglement p {
    color: var(--texte-2);
}

/* ---------- Appel à l'inscription ---------- */

.appel {
    position: relative;
    margin-top: clamp(64px, 9vw, 112px);
    padding: clamp(64px, 8vw, 96px) 0;
    background: linear-gradient(105deg, var(--def-fonce) 0%, var(--def-fonce) 49.9%, var(--att-fonce) 50.1%, var(--att-fonce) 100%);
    overflow: hidden;
}

.appel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url(../imgs/web/fond.webp) center / cover;
    mix-blend-mode: multiply;
    opacity: 0.55;
}

.appel__contenu {
    position: relative;
    text-align: center;
}

.appel h2 {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
}

.appel p {
    max-width: 52ch;
    margin: 18px auto 0;
    font-size: 1.2rem;
}

.appel__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 36px;
}

.appel .bouton {
    min-width: 200px;
    --fond-bouton: var(--texte);
    --texte-bouton: var(--nuit);
}

.appel .bouton--def { --texte-bouton: var(--def-fonce); }
.appel .bouton--att { --texte-bouton: var(--att-fonce); }

/* ---------- Contact ---------- */

.contact {
    padding-bottom: clamp(64px, 9vw, 112px);
}

.contact p {
    max-width: 60ch;
    color: var(--texte-2);
}

.contact__mail {
    display: inline-block;
    margin-top: 16px;
    font-family: var(--titre);
    font-size: clamp(1.3rem, 3vw, 2rem);
    font-weight: 600;
    text-decoration: none;
    word-break: break-word;
    border-bottom: 2px solid var(--ligne);
    transition: border-color 0.2s ease;
}

.contact__mail:hover {
    border-color: var(--texte);
}

/* ---------- Pied de page ---------- */

.pied {
    border-top: 1px solid var(--ligne);
    padding: 28px 0;
    font-size: 0.95rem;
    color: var(--texte-2);
}

.pied__contenu {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
}

/* =========================================================
   Adaptation aux écrans
   ========================================================= */

@media (max-width: 960px) {
    .reperes {
        grid-template-columns: repeat(2, 1fr);
    }

    .reperes li:nth-child(3) {
        border-left: 0;
    }

    .reperes li:nth-child(n + 3) {
        border-top: 1px solid var(--ligne);
    }

    .factions {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .faction {
        min-height: 520px;
    }

    .faction--def {
        clip-path: polygon(0 0, 100% 0, 100% calc(100% - 48px), 0 100%);
        margin: 0 0 -24px;
    }

    .faction--att {
        clip-path: polygon(0 48px, 100% 0, 100% 100%, 0 100%);
        margin: -24px 0 0;
    }

    .faction--def .faction__contenu {
        padding: 40px var(--marge) 112px;
    }

    .faction--att .faction__contenu {
        padding: 104px var(--marge) 48px;
        margin-left: 0;
        text-align: left;
    }

    /* Le texte occupe plus de hauteur : voile plus couvrant */
    .faction::before {
        background: linear-gradient(to top,
            rgb(var(--voile-rvb) / 0.97) 0%,
            rgb(var(--voile-rvb) / 0.85) 55%,
            rgb(var(--voile-rvb) / 0.25) 100%);
    }

    .factions__vs {
        width: 58px;
        height: 58px;
        font-size: 1.15rem;
    }

    .reglement {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 780px) {
    .menu-bouton {
        display: block;
        margin-right: -10px;
    }

    .entete--ouvert {
        background: rgb(var(--nuit-rvb) / 0.97);
    }

    .menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px var(--marge) 24px;
        background: rgb(var(--nuit-rvb) / 0.97);
        box-shadow: 0 1px 0 var(--ligne);
        visibility: hidden;
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    }

    .entete--ouvert .menu {
        visibility: visible;
        opacity: 1;
        transform: none;
    }

    .menu a:not(.bouton) {
        padding: 14px 0;
        font-size: 1.15rem;
        border-bottom: 1px solid var(--ligne);
    }

    .menu a:not(.bouton)::after {
        display: none;
    }

    .bouton--petit {
        margin: 20px 0 0;
        min-height: 52px;
    }

    .terrain {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    body {
        font-size: 1.05rem;
    }

    .hero {
        min-height: 92svh;
    }

    .hero__actions .bouton {
        flex: 1 1 100%;
    }

    .hero__controles {
        top: 84px;
        bottom: auto;
    }

    .reperes li {
        padding: 18px 12px;
    }

    .reperes strong {
        font-size: 1.4rem;
    }

    .faction {
        min-height: 480px;
    }

    .reglement li {
        grid-template-columns: 1fr;
    }

    .reglement li::before {
        grid-row: auto;
        padding: 0 0 4px;
    }

    .appel .bouton {
        flex: 1 1 100%;
    }
}
