/* ============================================================
   BacHO — Design System « La Médaille »
   Source de vérité unique pour toutes les pages.

   L'ADN vient des assets existants, pas d'une mode :
   - le marine et l'or sont ceux du logo (toque de diplômé)
   - le papier est celui d'une copie d'examen
   - le vert de validation est celui du cadre de la fiche officielle
   - les silhouettes de gymnastes sont la signature graphique
   ============================================================ */

:root {
    /* Les couleurs, familles et formes vivent dans bacho-tokens.css,
       chargé pour toutes les pages. Ici : l'échelle propre aux pages
       éditoriales, calibrée mobile d'abord. */

    --bh-t-display: clamp(2.7rem, 10.5vw, 5.75rem);
    --bh-t-h2: clamp(1.9rem, 6.2vw, 3.25rem);
    --bh-t-h3: clamp(1.15rem, 3.4vw, 1.5rem);
    --bh-t-lead: clamp(1.0625rem, 2.6vw, 1.25rem);
    --bh-t-body: 1rem;
    --bh-t-small: 0.875rem;
    --bh-t-micro: 0.6875rem;

    --bh-gut: clamp(1.25rem, 5vw, 2.5rem);
    --bh-section: clamp(4rem, 11vw, 8.5rem);
    --bh-max: 1240px;
}

/* ============================================================
   Réinitialisation minimale
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--bh-sans);
    font-size: var(--bh-t-body);
    line-height: 1.6;
    color: var(--bh-ink);
    background: var(--bh-paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-numeric: tabular-nums;
}

img,
svg,
video {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

a {
    color: inherit;
}

/* Le curseur personnalisé du layout n'apporte rien et gêne au tactile. */
.custom-cursor,
.cursor-follower {
    display: none !important;
}

::selection {
    background: var(--bh-primary-wash);
    color: var(--bh-ink);
}

:focus-visible {
    outline: 2px solid var(--bh-primary);
    outline-offset: 3px;
    border-radius: 3px;
}

/* ============================================================
   Primitives typographiques
   ============================================================ */

.bh-display {
    font-family: var(--bh-sans);
    font-weight: 800;
    font-stretch: 88%;
    font-size: var(--bh-t-display);
    line-height: 0.94;
    letter-spacing: -0.035em;
    margin: 0;
    text-wrap: balance;
}

.bh-h2 {
    font-weight: 700;
    font-stretch: 92%;
    font-size: var(--bh-t-h2);
    line-height: 1.02;
    letter-spacing: -0.028em;
    margin: 0;
    text-wrap: balance;
}

.bh-h3 {
    font-weight: 600;
    font-size: var(--bh-t-h3);
    line-height: 1.2;
    letter-spacing: -0.018em;
    margin: 0;
}

/* Le mot qui porte l'émotion : même famille, poids et couleur de marque. */
.bh-em {
    font-family: var(--bh-sans);
    font-style: normal;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--bh-primary);
}

.bh-lead {
    font-size: var(--bh-t-lead);
    line-height: 1.55;
    color: var(--bh-ink-2);
    margin: 0;
    max-width: 46ch;
}

/* La voix « formulaire officiel » : tout ce qui étiquette ou chiffre. */
.bh-label {
    font-family: var(--bh-mono);
    font-size: var(--bh-t-micro);
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bh-ink-3);
}

/* ============================================================
   Boutons
   ============================================================ */

.bh-btn {
    --btn-bg: var(--bh-primary);
    --btn-fg: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 52px;
    padding: 0 1.5rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s var(--bh-ease-out), box-shadow 0.2s var(--bh-ease-out),
        background 0.2s ease, color 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}

.bh-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 14px 28px -14px rgba(37, 99, 235, 0.45);
}

.bh-btn:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

.bh-btn:disabled,
.bh-btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
}

/* L'appel principal : le seul endroit où le dégradé bleu → violet apparaît. */
.bh-btn--gold {
    --btn-fg: #ffffff;
    background: var(--bh-gradient-brand);
    border-color: transparent;
}

.bh-btn--gold:hover {
    box-shadow: 0 16px 32px -14px rgba(124, 58, 237, 0.45);
}

.bh-btn--ghost {
    --btn-bg: transparent;
    --btn-fg: var(--bh-ink);
    border-color: var(--bh-ink-line);
}

.bh-btn--ghost:hover {
    border-color: var(--bh-primary);
    background: var(--bh-primary-wash);
    color: var(--bh-primary-dark);
    box-shadow: none;
}

.bh-btn--onink {
    --btn-bg: var(--bh-paper);
    --btn-fg: var(--bh-ink);
}

.bh-btn--sm {
    min-height: 42px;
    padding: 0 1.1rem;
    font-size: 0.9375rem;
}

.bh-btn--block {
    width: 100%;
}

/* ============================================================
   Pastilles de catégorie — reprises telles quelles de la fiche officielle
   ============================================================ */

.bh-cat {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 24px;
    padding: 0 6px;
    border: 1px solid var(--bh-ink-line);
    border-radius: var(--bh-r-chip);
    background: var(--bh-white);
    font-family: var(--bh-mono);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: var(--bh-ink);
}

.bh-cat--a {
    background: var(--bh-gold-wash);
    border-color: var(--bh-gold-line);
    color: #92400e;
}

.bh-cat--b {
    background: var(--bh-primary-wash);
    border-color: var(--bh-primary-line);
    color: var(--bh-primary-dark);
}

.bh-cat--c {
    background: var(--bh-green-wash);
    border-color: rgba(16, 185, 129, 0.32);
    color: var(--bh-green-dark);
}

.bh-cat--d {
    background: var(--bh-secondary-wash);
    border-color: var(--bh-secondary-line);
    color: var(--bh-secondary-dark);
}

.bh-cat--e {
    background: var(--bh-red-wash);
    border-color: rgba(239, 68, 68, 0.26);
    color: var(--bh-red-dark);
}

.bh-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.7rem;
    border: 1px solid var(--bh-ink-line);
    border-radius: 999px;
    background: var(--bh-white);
    font-family: var(--bh-mono);
    font-size: var(--bh-t-micro);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bh-ink-2);
}

.bh-tag--ok {
    background: var(--bh-green-wash);
    border-color: rgba(16, 185, 129, 0.25);
    color: var(--bh-green-dark);
}

.bh-tag--ko {
    background: var(--bh-red-wash);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--bh-red-dark);
}

/* ============================================================
   Surfaces
   ============================================================ */

.bh-card {
    background: var(--bh-white);
    border: 1px solid var(--bh-ink-line);
    border-radius: var(--bh-r-card);
    box-shadow: var(--bh-shadow);
}

.bh-wrap {
    width: 100%;
    max-width: var(--bh-max);
    margin-inline: auto;
    padding-inline: var(--bh-gut);
}

/* Le papier réglé : la trame de fond du site. */
.bh-ruled {
    background-image:
        linear-gradient(var(--bh-ink-line-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--bh-ink-line-soft) 1px, transparent 1px);
    background-size: 100% 34px, 34px 100%;
}

/* ============================================================
   Révélation au scroll — discrète, jamais spectaculaire pour rien
   ============================================================ */

.bh-reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.7s var(--bh-ease-out), transform 0.7s var(--bh-ease-out);
    transition-delay: var(--bh-delay, 0s);
}

.bh-reveal.is-in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .bh-reveal {
        opacity: 1;
        transform: none;
    }
}

.bh-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
