/* ==========================================================================
   Bricolo — direction « atelier »
   Papier kraft, encre, plan de découpe. Typo Bricolage Grotesque + Newsreader.
   ========================================================================== */

/* --------------------------------------------------------------- 1. Jetons */

:root {
    color-scheme: light dark;

    --paper:        #faf4e8;
    --paper-2:      #f3ead8;
    --paper-3:      #eadfc7;
    --card:         #fffdf8;
    --ink:          #1d1a14;
    --ink-2:        #4d4636;
    --ink-3:        #7d7362;
    --line:         #ded0b4;
    --line-strong:  #c6b28a;

    --blue:         #1b4b73;
    --blue-soft:    #e4edf5;
    --orange:       #d1451b;
    --orange-dark:  #a83614;
    --orange-soft:  #fbe7de;
    --yellow:       #f0b429;
    --yellow-soft:  #fdf0cf;
    --green:        #3f7a52;

    /* Matières de l'atelier, utilisées par la scène de la page 404. */
    --wood:         #e0bd83;
    --wood-2:       #c79c5c;
    --wood-line:    #9d7639;
    --steel:        #c3c7cd;
    --steel-2:      #8b9098;

    /* Trait de surligneur sous un mot clé. Sur fond sombre il doit s'effacer :
       du jaune à 50 % derrière du texte orange devient illisible. */
    --mark-alpha:   .5;

    --shadow-sm:  0 1px 0 var(--line), 0 2px 6px rgb(60 45 20 / .06);
    --shadow-md:  0 2px 0 var(--line-strong), 0 10px 26px rgb(60 45 20 / .12);
    --shadow-lg:  0 3px 0 var(--line-strong), 0 22px 48px rgb(60 45 20 / .17);

    --radius:     14px;
    --radius-lg:  22px;

    --font-display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
    --font-body:    "Newsreader", Georgia, "Times New Roman", serif;
    --font-mono:    "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

    --wrap:  1180px;
    --gutter: clamp(1rem, 4vw, 2.5rem);

    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper:       #15130f;
        --paper-2:     #1c1915;
        --paper-3:     #24201a;
        --card:        #1e1b16;
        --ink:         #f4ead8;
        --ink-2:       #c6b9a1;
        --ink-3:       #93876f;
        --line:        #362f25;
        --line-strong: #4a4133;

        --blue:        #7fb3dd;
        --blue-soft:   #1c2b39;
        --orange:      #ff7a4d;
        --orange-dark: #ff9670;
        --orange-soft: #33201a;
        --yellow:      #f5c451;
        --yellow-soft: #302512;
        --green:       #7cb98d;

        --wood:        #a67c42;
        --wood-2:      #855f2e;
        --wood-line:   #5f4320;
        --steel:       #8f959e;
        --steel-2:     #626871;

        --mark-alpha:  .26;

        --shadow-sm: 0 1px 0 var(--line), 0 2px 6px rgb(0 0 0 / .4);
        --shadow-md: 0 2px 0 var(--line-strong), 0 12px 28px rgb(0 0 0 / .5);
        --shadow-lg: 0 3px 0 var(--line-strong), 0 24px 50px rgb(0 0 0 / .55);
    }
}

[data-theme="dark"] {
    --wood:        #a67c42;
    --wood-2:      #855f2e;
    --wood-line:   #5f4320;
    --steel:       #8f959e;
    --steel-2:     #626871;
    --mark-alpha:  .26;
    --paper:       #15130f;
    --paper-2:     #1c1915;
    --paper-3:     #24201a;
    --card:        #1e1b16;
    --ink:         #f4ead8;
    --ink-2:       #c6b9a1;
    --ink-3:       #93876f;
    --line:        #362f25;
    --line-strong: #4a4133;
    --blue:        #7fb3dd;
    --blue-soft:   #1c2b39;
    --orange:      #ff7a4d;
    --orange-dark: #ff9670;
    --orange-soft: #33201a;
    --yellow:      #f5c451;
    --yellow-soft: #302512;
    --green:       #7cb98d;
    --shadow-sm: 0 1px 0 var(--line), 0 2px 6px rgb(0 0 0 / .4);
    --shadow-md: 0 2px 0 var(--line-strong), 0 12px 28px rgb(0 0 0 / .5);
    --shadow-lg: 0 3px 0 var(--line-strong), 0 24px 50px rgb(0 0 0 / .55);
}

/* ---------------------------------------------------------------- 2. Base */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 5.5rem;
}

body {
    margin: 0;
    background-color: var(--paper);
    background-image: var(--grain);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: clamp(1rem, .96rem + .2vw, 1.09rem);
    line-height: 1.65;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-underline-offset: .18em; text-decoration-thickness: .07em; }
a:hover { color: var(--orange); }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.02em;
    margin: 0 0 .5em;
    text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.9rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 1.1rem + .6vw, 1.5rem); }

p { margin: 0 0 1em; }
ul, ol { padding-left: 1.15em; }

:focus-visible {
    outline: 3px solid var(--orange);
    outline-offset: 3px;
    border-radius: 4px;
}

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2 * var(--gutter), 44rem); margin-inline: auto; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px;
    padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 1rem; top: -4rem; z-index: 100;
    background: var(--orange); color: #fff; padding: .7rem 1.1rem;
    border-radius: 0 0 var(--radius) var(--radius); font-family: var(--font-display);
    font-weight: 700; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 0; color: #fff; }

/* Étiquette technique : durées, difficultés, catégories. */
.tag {
    font-family: var(--font-mono);
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-3);
}

/* -------------------------------------------------------------- 3. En-tête */

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--line);
}

.site-header__inner {
    display: flex; align-items: center; gap: clamp(.75rem, 3vw, 2rem);
    padding-block: .7rem;
}

/* Volontairement pas un flex : les nœuds texte deviendraient des items
   séparés par le gap et le mot se disloquerait. */
.wordmark {
    display: inline-block; white-space: nowrap;
    font-family: var(--font-display);
    font-size: 1.65rem; font-weight: 800; letter-spacing: -.045em;
    color: var(--ink); text-decoration: none; flex: none;
}
.wordmark em {
    font-style: normal; color: var(--orange);
    display: inline-block; transform: rotate(-7deg); transform-origin: bottom center;
    transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.wordmark:hover { color: var(--ink); }
.wordmark:hover em { transform: rotate(9deg) scale(1.12); }
.wordmark small {
    font-family: var(--font-mono); font-size: .58rem; font-weight: 400;
    letter-spacing: .16em; color: var(--ink-3); text-transform: uppercase;
    margin-left: .18rem;
}

.site-nav { display: flex; align-items: center; gap: .2rem; margin-left: auto; }
.site-nav a {
    font-family: var(--font-display); font-weight: 600; font-size: .95rem;
    color: var(--ink-2); text-decoration: none; padding: .45rem .7rem; border-radius: 9px;
}
.site-nav a:hover, .site-nav a[aria-current] { background: var(--paper-3); color: var(--ink); }

.header-search { flex: none; }
.header-search__toggle {
    display: grid; place-items: center; width: 2.5rem; height: 2.5rem;
    border: 1px solid var(--line-strong); border-radius: 50%;
    background: var(--card); color: var(--ink); cursor: pointer;
}
.header-search__toggle:hover { background: var(--orange); color: #fff; border-color: var(--orange); }
.page-home .header-search__toggle { display: none; }

@media (max-width: 640px) {
    .site-nav a { padding: .4rem .5rem; font-size: .88rem; }
    .site-nav a.is-secondary { display: none; }
}

/* ---------------------------------------------------------------- 4. Héros */

/* Pas d'overflow:hidden ici : il rognerait la liste de suggestions de la
   recherche, qui déborde du héros. Le quadrillage est déjà borné par inset:0. */
.hero {
    position: relative;
    padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3.5rem);
}

/* Quadrillage de plan technique, atténué vers le bas. */
.hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 34px 34px;
    opacity: .5;
    mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
}

.hero__inner { position: relative; }

.hero__eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    font-family: var(--font-mono); font-size: .72rem; letter-spacing: .18em;
    text-transform: uppercase; color: var(--ink-2);
    background: var(--yellow-soft); border: 1px dashed var(--line-strong);
    padding: .35rem .75rem; border-radius: 999px; margin-bottom: 1.2rem;
}
.hero__eyebrow b { color: var(--orange); font-weight: 700; }

.hero h1 { max-width: 16ch; margin-bottom: .4em; }
.hero h1 span {
    position: relative; white-space: nowrap; color: var(--orange);
}
/* Trait de crayon sous le mot clé. */
.hero h1 span::after {
    content: ""; position: absolute; left: -.06em; right: -.06em; bottom: .04em; height: .3em;
    background: var(--yellow); opacity: var(--mark-alpha); z-index: -1; border-radius: 3px;
    transform: rotate(-.6deg);
}

.hero__lede {
    max-width: 46ch; font-size: 1.15rem; color: var(--ink-2); margin-bottom: 1.8rem;
}

/* ------------------------------------------------------------ 5. Recherche */

.search {
    position: relative; max-width: 42rem; z-index: 41;
}

.search__field {
    display: flex; align-items: center; gap: .6rem;
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: 999px;
    padding: .35rem .35rem .35rem 1.15rem;
    box-shadow: var(--shadow-md);
    transition: box-shadow .2s, transform .2s;
}
.search__field:focus-within { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.search__field svg { flex: none; color: var(--ink-3); }

.search input[type="search"] {
    flex: 1; min-width: 0; border: 0; background: none; outline: none;
    font-family: var(--font-body); font-size: 1.08rem; color: var(--ink);
    padding: .7rem 0;
}
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search__submit {
    flex: none; border: 0; cursor: pointer;
    background: var(--orange); color: #fff;
    font-family: var(--font-display); font-weight: 700; font-size: .95rem;
    padding: .72rem 1.35rem; border-radius: 999px;
    transition: background .18s, transform .18s;
}
.search__submit:hover { background: var(--orange-dark); transform: scale(1.03); }

.search__hints {
    display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .9rem;
    font-family: var(--font-mono); font-size: .74rem;
}
.search__hints span { color: var(--ink-3); align-self: center; }
.search__hints button {
    border: 1px solid var(--line-strong); background: transparent; cursor: pointer;
    color: var(--ink-2); border-radius: 999px; padding: .28rem .7rem;
    font-family: inherit; font-size: inherit;
}
.search__hints button:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Résultats au fil de la frappe */
.search__results {
    position: absolute; top: calc(100% + .6rem); left: 0; right: 0; z-index: 40;
    background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); overflow: hidden;
    max-height: min(60vh, 30rem); overflow-y: auto;
}
.search__results:empty { display: none; }

.search__result {
    display: flex; align-items: center; gap: .9rem; padding: .6rem .8rem;
    text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line);
}
.search__result:last-child { border-bottom: 0; }
.search__result:hover, .search__result:focus-visible, .search__result[aria-selected="true"] {
    background: var(--paper-2); color: var(--ink); outline: none;
}
.search__result img {
    width: 62px; height: 46px; object-fit: cover; border-radius: 8px; flex: none;
    border: 1px solid var(--line);
}
.search__result strong { font-family: var(--font-display); font-size: 1rem; display: block; }
.search__result .tag { display: block; margin-top: .1rem; }

.search__more {
    display: block; text-align: center; padding: .7rem; font-family: var(--font-display);
    font-weight: 700; background: var(--paper-2); text-decoration: none;
}

.search__empty { padding: 1.1rem; color: var(--ink-3); text-align: center; }

/* ---------------------------------------------------------- 6. Catégories */

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
    display: inline-flex; align-items: center; gap: .45rem;
    background: var(--card); border: 1px solid var(--line-strong);
    border-radius: 999px; padding: .42rem .9rem;
    font-family: var(--font-display); font-weight: 600; font-size: .9rem;
    color: var(--ink); text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform .18s, background .18s, border-color .18s;
}
.chip:hover, .chip[aria-current] {
    transform: translateY(-2px);
    background: hsl(var(--hue, 30) 80% 92%);
    border-color: hsl(var(--hue, 30) 45% 55%);
    color: var(--ink);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .chip:hover,
    :root:not([data-theme="light"]) .chip[aria-current] {
        background: hsl(var(--hue, 30) 35% 22%);
    }
}
.chip b { font-weight: 400; color: var(--ink-3); font-family: var(--font-mono); font-size: .74rem; }

/* --------------------------------------------------------------- 7. Grille */

.section { padding-block: clamp(2rem, 5vw, 3.6rem); }

.section__head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap;
}
.section__head h2 { margin: 0; }
.section__head p { margin: .2rem 0 0; color: var(--ink-3); font-size: .95rem; }
.section__head a {
    font-family: var(--font-display); font-weight: 700; font-size: .92rem;
    text-decoration: none; border-bottom: 2px solid var(--orange); padding-bottom: 2px;
}

.grid {
    display: grid; gap: clamp(1rem, 2.2vw, 1.7rem);
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
}

/* La première carte occupe deux colonnes : la grille cesse d'être un damier. */
.grid--featured > .card:first-child { grid-column: span 2; }
@media (min-width: 62rem) {
    .grid--featured > .card:first-child { grid-row: span 2; }
    /* L'image absorbe la hauteur restante : sans cela, la carte haute
       se creuse d'un grand vide entre le texte et les métadonnées. */
    .grid--featured > .card:first-child .card__media {
        aspect-ratio: auto; flex: 1 1 auto; min-height: 20rem;
    }
    .grid--featured > .card:first-child .card__body { flex: 0 0 auto; padding: 1.3rem 1.5rem 1.5rem; }
    .grid--featured > .card:first-child .card__title { font-size: 1.85rem; }
    .grid--featured > .card:first-child .card__desc { display: block; }
}
@media (max-width: 40rem) {
    .grid--featured > .card:first-child { grid-column: span 1; }
}

.card {
    position: relative; display: flex; flex-direction: column;
    background: var(--card); border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .22s cubic-bezier(.34, 1.3, .64, 1), box-shadow .22s;
}
.card:hover { transform: translateY(-5px) rotate(-.35deg); box-shadow: var(--shadow-md); }
.card:focus-within { box-shadow: var(--shadow-md); }

.card__media {
    position: relative; aspect-ratio: 4 / 3; background: var(--paper-3); overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card__media img { transform: scale(1.045); }

/* Ruban adhésif en haut de carte : le clin d'œil « atelier ». */
.card__tape {
    position: absolute; top: -.55rem; left: 50%; z-index: 2;
    width: 5.2rem; height: 1.5rem; transform: translateX(-50%) rotate(-2.5deg);
    background: color-mix(in srgb, var(--yellow) 62%, transparent);
    border-left: 1px dashed rgb(255 255 255 / .5);
    border-right: 1px dashed rgb(255 255 255 / .5);
    box-shadow: 0 1px 3px rgb(60 45 20 / .18);
}
.card:nth-child(3n) .card__tape { transform: translateX(-50%) rotate(3deg); }
.card:nth-child(4n) .card__tape { transform: translateX(-58%) rotate(-5deg); }

.card__badge {
    position: absolute; left: .7rem; bottom: .7rem; z-index: 2;
    display: inline-flex; align-items: center; gap: .35rem;
    background: var(--card); border: 1px solid var(--line-strong);
    border-radius: 999px; padding: .25rem .65rem;
    font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em;
    text-transform: uppercase; color: var(--ink-2);
}

.card__body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; flex: 1; }

.card__title {
    font-family: var(--font-display); font-weight: 800; font-size: 1.18rem;
    line-height: 1.15; letter-spacing: -.015em; margin: 0 0 .45rem;
}
.card__title a { color: inherit; text-decoration: none; }
/* Toute la carte est cliquable, sans imbriquer de liens. */
.card__title a::after { content: ""; position: absolute; inset: 0; z-index: 3; }
.card:hover .card__title { color: var(--orange); }

.card__desc {
    display: none; color: var(--ink-2); font-size: .98rem; margin: 0 0 .8rem;
}

.card__meta {
    margin-top: auto; display: flex; flex-wrap: wrap; gap: .35rem .9rem;
    padding-top: .7rem; border-top: 1px dashed var(--line-strong);
}
.card__meta span {
    display: inline-flex; align-items: center; gap: .3rem;
    font-family: var(--font-mono); font-size: .7rem; color: var(--ink-3);
}
.card__meta .is-shop { color: var(--orange); }

/* Apparition en cascade au chargement. */
@media (prefers-reduced-motion: no-preference) {
    .grid > .card { animation: card-in .5s both cubic-bezier(.22, .68, .36, 1); }
    .grid > .card:nth-child(1) { animation-delay: .02s; }
    .grid > .card:nth-child(2) { animation-delay: .07s; }
    .grid > .card:nth-child(3) { animation-delay: .12s; }
    .grid > .card:nth-child(4) { animation-delay: .17s; }
    .grid > .card:nth-child(5) { animation-delay: .22s; }
    .grid > .card:nth-child(6) { animation-delay: .27s; }
    .grid > .card:nth-child(n+7) { animation-delay: .3s; }
}
@keyframes card-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------- 8. Fiche */

/* Colonne de lecture resserrée : la fiche est un texte suivi, pas un tableau
   de bord. Le bloc matériel garde ainsi son bouton près de son libellé. */
.fiche {
    width: min(100% - 2 * var(--gutter), 48rem);
    margin-inline: auto;
    padding-block: 1.5rem clamp(2rem, 5vw, 4rem);
}

.breadcrumb {
    font-family: var(--font-mono); font-size: .72rem; color: var(--ink-3);
    margin-bottom: 1.4rem; display: flex; flex-wrap: wrap; gap: .35rem;
}
.breadcrumb a { color: var(--ink-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--orange); }

.fiche__head { max-width: 46rem; }
.fiche__head h1 { margin-bottom: .35em; }

.fiche__lede { font-size: 1.2rem; color: var(--ink-2); max-width: 42ch; }

/* Bandeau de caractéristiques : la réponse aux questions « combien de temps,
   quel niveau, quel matériel » avant même de lire. */
.specs {
    display: flex; flex-wrap: wrap; gap: 0;
    margin: 1.8rem 0; border: 1px solid var(--line-strong); border-radius: var(--radius);
    background: var(--card); overflow: hidden; box-shadow: var(--shadow-sm);
}
.specs__item {
    flex: 1 1 8rem; padding: .8rem 1rem;
    border-right: 1px dashed var(--line-strong);
}
.specs__item:last-child { border-right: 0; }
.specs__item dt {
    font-family: var(--font-mono); font-size: .66rem; letter-spacing: .12em;
    text-transform: uppercase; color: var(--ink-3); margin-bottom: .15rem;
}
.specs__item dd {
    margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
    display: flex; align-items: center; gap: .35rem;
}

.level { display: inline-flex; gap: 3px; }
.level i {
    width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong);
    display: block;
}
.level i.on { background: var(--green); }
.level[data-level="3"] i.on { background: var(--orange); }

.fiche__cover {
    margin: 0 0 2rem; border-radius: var(--radius-lg); overflow: hidden;
    border: 1px solid var(--line-strong); box-shadow: var(--shadow-md); background: var(--paper-3);
}
.fiche__cover img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.fiche__cover figcaption {
    font-family: var(--font-mono); font-size: .7rem; color: var(--ink-3);
    padding: .5rem .9rem; background: var(--card); border-top: 1px solid var(--line);
}

.prose { max-width: 42rem; }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; }
.prose img { border-radius: var(--radius); margin-block: 1.2rem; }
.prose blockquote {
    margin: 1.4rem 0; padding: .2rem 0 .2rem 1.1rem;
    border-left: 4px solid var(--yellow); color: var(--ink-2); font-style: italic;
}
.prose code {
    font-family: var(--font-mono); font-size: .85em;
    background: var(--paper-3); padding: .12em .35em; border-radius: 5px;
}

/* Résumé du matériel, juste après l'intro : l'utilisateur voit tout de suite
   ce qu'il lui faut, et le lien d'ancre l'emmène au bloc marchand. */
.needs {
    margin: 2rem 0; padding: 1.1rem 1.3rem;
    background: var(--blue-soft); border: 1px solid var(--line-strong);
    border-left: 5px solid var(--blue); border-radius: var(--radius);
}
.needs h2 { font-size: 1.1rem; margin: 0 0 .6rem; }
.needs ul { margin: 0; padding-left: 1.1em; columns: 2; column-gap: 2rem; }
.needs li { margin-bottom: .2rem; break-inside: avoid; }
.needs a { font-family: var(--font-display); font-weight: 700; display: inline-block; margin-top: .7rem; }
@media (max-width: 34rem) { .needs ul { columns: 1; } }

/* Étapes numérotées */
.steps { counter-reset: step; margin: 2.4rem 0; max-width: 42rem; }

.step {
    counter-increment: step;
    position: relative; padding-left: 3.6rem; padding-bottom: 1.8rem;
}
.step::before {
    content: counter(step);
    position: absolute; left: 0; top: -.35rem;
    width: 2.6rem; height: 2.6rem; display: grid; place-items: center;
    font-family: var(--font-display); font-weight: 800; font-size: 1.25rem;
    color: var(--orange); background: var(--card);
    border: 2px solid var(--ink); border-radius: 50%;
    box-shadow: 3px 3px 0 var(--ink);
}
/* Fil pointillé entre les étapes, comme une ligne de découpe. */
.step:not(:last-child)::after {
    content: ""; position: absolute; left: 1.3rem; top: 2.6rem; bottom: .2rem;
    border-left: 2px dashed var(--line-strong);
}
.step h3 { margin: 0 0 .35rem; font-size: 1.22rem; }
.step p:last-child { margin-bottom: 0; }
.step img { border-radius: var(--radius); margin-top: .9rem; }

/* Astuces : bloc post-it légèrement de travers */
.tips {
    margin: 2.4rem 0; padding: 1.3rem 1.5rem;
    background: var(--yellow-soft); border: 1px solid var(--line-strong);
    border-radius: 4px 18px 6px 16px; transform: rotate(-.5deg);
    box-shadow: var(--shadow-md); max-width: 40rem;
}
.tips h2 { font-size: 1.15rem; margin: 0 0 .6rem; display: flex; align-items: center; gap: .5rem; }
.tips ul { margin: 0; padding-left: 1.15em; }
.tips li { margin-bottom: .35rem; }
.tips li:last-child { margin-bottom: 0; }

/* Vidéo */
.video {
    margin: 2.4rem 0; aspect-ratio: 16 / 9; border-radius: var(--radius-lg);
    overflow: hidden; border: 1px solid var(--line-strong); box-shadow: var(--shadow-md);
    background: var(--paper-3);
}
.video iframe { width: 100%; height: 100%; border: 0; }
.video button {
    position: relative; width: 100%; height: 100%; border: 0; cursor: pointer; padding: 0;
    background-size: cover; background-position: center;
}
.video button::after {
    content: "▶"; position: absolute; inset: 0; margin: auto;
    width: 4.5rem; height: 4.5rem; display: grid; place-items: center;
    background: var(--orange); color: #fff; border-radius: 50%; font-size: 1.4rem;
    box-shadow: var(--shadow-lg);
}

/* FAQ */
.faq { margin: 2.4rem 0; max-width: 40rem; }
.faq details {
    border-bottom: 1px dashed var(--line-strong); padding: .3rem 0;
}
.faq summary {
    cursor: pointer; padding: .7rem 0; list-style: none;
    font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
    display: flex; justify-content: space-between; gap: 1rem; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--orange); font-size: 1.4rem; flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq details > p { margin: 0 0 .9rem; color: var(--ink-2); }

/* ------------------------------------------------- 9. Bloc matériel (money) */

.shop {
    margin: 3rem 0; scroll-margin-top: 6rem;
    border: 2px solid var(--ink); border-radius: var(--radius-lg);
    background: var(--card); box-shadow: var(--shadow-lg); overflow: hidden;
}

.shop__head {
    padding: 1.2rem 1.4rem .9rem;
    background: var(--paper-2); border-bottom: 2px dashed var(--line-strong);
}
.shop__head h2 { margin: 0 0 .2rem; font-size: 1.4rem; display: flex; align-items: center; gap: .55rem; }
.shop__head p { margin: 0; color: var(--ink-3); font-size: .88rem; }

.shop__list { list-style: none; margin: 0; padding: 0; }

.shop__item {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    padding: .85rem 1.4rem;
    border-bottom: 1px solid var(--line);
}
.shop__item:last-child { border-bottom: 0; }
.shop__item:hover { background: var(--paper-2); }

/* Case à cocher décorative : la liste se lit comme une liste de courses. */
.shop__check {
    flex: none; width: 1.35rem; height: 1.35rem; border: 2px solid var(--line-strong);
    border-radius: 5px; display: grid; place-items: center; color: transparent;
    font-size: .9rem; cursor: pointer; background: var(--card);
    transition: background .15s, color .15s, border-color .15s;
}
.shop__check[aria-pressed="true"] {
    background: var(--green); border-color: var(--green); color: #fff;
}

.shop__label { flex: 1 1 12rem; min-width: 0; }
.shop__label b { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; }
.shop__label span { color: var(--ink-3); font-family: var(--font-mono); font-size: .74rem; }
.shop__label small { display: block; color: var(--ink-2); font-size: .85rem; }
.shop__item.is-done .shop__label b { text-decoration: line-through; color: var(--ink-3); }

.btn-amazon {
    flex: none; display: inline-flex; align-items: center; gap: .45rem;
    background: var(--orange); color: #fff; text-decoration: none;
    font-family: var(--font-display); font-weight: 700; font-size: .88rem;
    padding: .52rem 1rem; border-radius: 999px; white-space: nowrap;
    box-shadow: 0 2px 0 var(--orange-dark);
    transition: transform .16s, background .16s, box-shadow .16s;
}
.btn-amazon:hover {
    background: var(--orange-dark); color: #fff;
    transform: translateY(-2px); box-shadow: 0 4px 0 var(--orange-dark);
}
.btn-amazon:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--orange-dark); }
.btn-amazon svg { flex: none; }

.shop__owned {
    flex: none; font-family: var(--font-mono); font-size: .7rem; color: var(--ink-3);
    border: 1px dashed var(--line-strong); border-radius: 999px; padding: .3rem .7rem;
}

.shop__foot {
    padding: .9rem 1.4rem; background: var(--paper-2);
    border-top: 2px dashed var(--line-strong);
    display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between;
}
.shop__all {
    display: inline-flex; align-items: center; gap: .5rem;
    background: var(--ink); color: var(--paper); text-decoration: none;
    font-family: var(--font-display); font-weight: 700; font-size: .92rem;
    padding: .6rem 1.2rem; border-radius: 999px;
}
.shop__all:hover { background: var(--orange); color: #fff; }

.disclosure {
    font-size: .76rem; color: var(--ink-3); line-height: 1.5; max-width: 46ch; margin: 0;
}

/* Barre collante mobile : le matériel reste à un pouce de distance. */
.sticky-cta {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: none; align-items: center; justify-content: space-between; gap: .8rem;
    padding: .7rem var(--gutter) calc(.7rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--card) 94%, transparent);
    backdrop-filter: blur(10px); border-top: 2px solid var(--ink);
    transform: translateY(110%); transition: transform .3s ease;
}
.sticky-cta.is-visible { transform: none; }
.sticky-cta strong { font-family: var(--font-display); font-size: .95rem; }
.sticky-cta span { display: block; font-family: var(--font-mono); font-size: .68rem; color: var(--ink-3); }
@media (max-width: 52rem) {
    .page-fiche .sticky-cta { display: flex; }
    /* La barre est en position fixe : sans cette réserve, elle masque le pied de page. */
    .page-fiche .site-footer { padding-bottom: 6rem; }
}

/* ------------------------------------------------------------ 10. Listes */

.page-head {
    padding-block: clamp(2rem, 4vw, 3rem) 1.2rem; position: relative;
}
.page-head h1 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.page-head h1 i { font-style: normal; font-size: .85em; }
.page-head p { color: var(--ink-2); margin: 0; }

.pagination {
    display: flex; justify-content: center; align-items: center; gap: .5rem;
    margin-top: 2.5rem; font-family: var(--font-display); font-weight: 700;
}
.pagination a, .pagination span {
    min-width: 2.6rem; height: 2.6rem; display: grid; place-items: center;
    border: 1px solid var(--line-strong); border-radius: 10px; text-decoration: none;
    background: var(--card); color: var(--ink); padding-inline: .6rem;
}
.pagination a:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pagination [aria-current] { background: var(--orange); color: #fff; border-color: var(--orange); }
.pagination .is-disabled { opacity: .35; }

.empty {
    text-align: center; padding: 3rem 1rem; color: var(--ink-2);
    border: 2px dashed var(--line-strong); border-radius: var(--radius-lg);
    background: var(--card);
}
.empty h2 { margin-bottom: .3rem; }

/* ---------------------------------------------------- 11. Page 404 « chantier »

   Le 404 est monté en planches : le zéro est une lame de scie, une planche du
   second quatre pend sur son clou, la sciure tombe. Tout est en SVG en ligne et
   animé en CSS — aucune image, aucun script.
   ------------------------------------------------------------------------- */

.crash {
    position: relative;
    padding-block: clamp(1.5rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem);
    text-align: center;
    overflow: clip;
}

/* Établi : quadrillage de plan technique estompé sur les bords. */
.crash::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 34px 34px;
    opacity: .55;
    mask-image: radial-gradient(75% 70% at 50% 45%, #000 25%, transparent 75%);
}

.crash__inner { position: relative; }

.crash__scene {
    width: min(100%, 44rem);
    height: auto;
    margin-inline: auto;
    overflow: visible;
    filter: drop-shadow(0 14px 22px rgb(60 45 20 / .18));
}

.crash h1 {
    margin-top: .6rem;
    font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem);
}
.crash h1 span { color: var(--orange); position: relative; white-space: nowrap; }
.crash h1 span::after {
    content: ""; position: absolute; left: -.06em; right: -.06em; bottom: .06em; height: .28em;
    background: var(--yellow); opacity: var(--mark-alpha); z-index: -1; border-radius: 3px;
    transform: rotate(-.8deg);
}

.crash__lede {
    max-width: 46ch; margin-inline: auto;
    font-size: 1.12rem; color: var(--ink-2);
}

.crash .hero__eyebrow { margin-bottom: 0; }

/* --- pièces de la scène --- */

.plank    { fill: url(#bois); stroke: var(--wood-line); stroke-width: 2; }
.screw    { fill: var(--steel-2); }
.screw-slot { stroke: var(--paper); stroke-width: 2.4; stroke-linecap: round; }
.blade    { fill: var(--steel); stroke: var(--steel-2); stroke-width: 2; }
.blade-eye { fill: var(--paper-3); stroke: var(--steel-2); stroke-width: 2; }
.nail     { fill: var(--steel-2); }
.dust     { fill: var(--wood-2); }

@media (prefers-reduced-motion: no-preference) {
    /* Chute puis rebond de l'ensemble à l'arrivée sur la page. */
    .crash__scene { animation: crash-settle 1s cubic-bezier(.2, .9, .3, 1.4) both; }

    /* La lame tourne lentement : assez pour vivre, pas assez pour distraire. */
    .crash__blade { animation: crash-spin 9s linear infinite; transform-origin: 372px 152px; }

    /* La planche mal fixée oscille sur son unique clou. */
    .crash__loose { animation: crash-swing 3.4s ease-in-out infinite; transform-origin: 600px 44px; }

    /* Une vis se dévisse, tombe, et l'on recommence. */
    .crash__screw { animation: crash-unscrew 6s ease-in infinite; transform-origin: 95px 196px; }

    .crash__dust circle {
        animation: crash-dust 2.6s linear infinite;
        animation-delay: var(--d, 0s);
        opacity: 0;
    }

    /* Passer la souris sur la scène lance la scie pour de bon. */
    .crash__scene:hover .crash__blade { animation-duration: 1.1s; }
    .crash__scene:hover .crash__dust circle { animation-duration: .9s; }
}

@keyframes crash-settle {
    0%   { transform: translateY(-120px) rotate(-4deg); opacity: 0; }
    60%  { opacity: 1; }
    100% { transform: none; opacity: 1; }
}

@keyframes crash-spin { to { transform: rotate(360deg); } }

@keyframes crash-swing {
    0%, 100% { transform: rotate(-4deg); }
    50%      { transform: rotate(5deg); }
}

/* L'ordre compte : la translation s'applique dans le repère du parent, la
   rotation ensuite sur place. L'inverse ferait remonter la vis à mi-parcours. */
@keyframes crash-unscrew {
    0%, 45%   { transform: translateY(0) rotate(0); opacity: 1; }
    60%       { transform: translateY(-4px) rotate(220deg); opacity: 1; }
    88%       { transform: translateY(150px) rotate(900deg); opacity: 1; }
    97%, 100% { transform: translateY(170px) rotate(1000deg); opacity: 0; }
}

@keyframes crash-dust {
    0%   { transform: translateY(0) scale(1); opacity: 0; }
    12%  { opacity: .85; }
    100% { transform: translateY(120px) scale(.4); opacity: 0; }
}

/* --- encart perceuse : la conclusion logique de la blague --- */

.drill {
    display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.2rem); flex-wrap: wrap;
    margin: clamp(2rem, 4vw, 3rem) auto 0;
    max-width: 46rem; padding: clamp(1.1rem, 3vw, 1.8rem);
    background: var(--card); border: 2px solid var(--ink);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}

.drill__art { flex: none; width: clamp(9rem, 26vw, 12.5rem); height: auto; overflow: visible; }
/* .crash centre tout son contenu : l'encart, lui, se lit aligné à gauche. */
.drill__body { flex: 1 1 16rem; min-width: 0; text-align: left; }
.drill__body h2 { font-size: clamp(1.15rem, 1rem + .8vw, 1.5rem); margin-bottom: .35rem; }
.drill__body p { color: var(--ink-2); font-size: .98rem; margin-bottom: .9rem; }

.drill-shell { fill: var(--orange); }
.drill-grip  { fill: var(--ink); }
.drill-metal { fill: var(--steel); stroke: var(--steel-2); stroke-width: 2; }
.drill-batt  { fill: var(--steel-2); }
.drill-vent  { stroke: var(--orange-dark); stroke-width: 3; stroke-linecap: round; }

/* La mèche « tourne » par défilement des tirets : en 2D, c'est ce qui lit
   le mieux la rotation d'un foret. */
.drill-bit {
    stroke: var(--steel-2); stroke-width: 7; stroke-linecap: round;
    stroke-dasharray: 7 7;
}
.drill-chip { fill: var(--wood-2); opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
    .drill-bit  { animation: drill-turn 1.1s linear infinite; }
    .drill__art { animation: drill-idle 2.8s ease-in-out infinite; transform-origin: 60% 60%; }
    .drill-chip { animation: drill-chip 1.4s ease-out infinite; animation-delay: var(--d, 0s); }

    /* Au survol du bloc, la perceuse s'emballe. */
    .drill:hover .drill-bit  { animation-duration: .35s; }
    .drill:hover .drill__art { animation: drill-run .12s linear infinite; }
}

@keyframes drill-turn  { to { stroke-dashoffset: -28; } }
@keyframes drill-idle  { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
@keyframes drill-run   { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(1.5px, -1.5px); } }
@keyframes drill-chip  {
    0%   { transform: translate(0, 0) scale(1); opacity: .9; }
    100% { transform: translate(26px, -18px) scale(.3); opacity: 0; }
}

@media (max-width: 34rem) {
    .drill { justify-content: center; }
    .drill__body { flex-basis: 100%; text-align: center; }
}

/* --------------------------------------------------------- 12. Publicité */

.ad {
    margin: 2.5rem auto; text-align: center; min-height: 90px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: 1px dashed var(--line); border-radius: var(--radius); overflow: hidden;
}
.ad::before {
    content: "Publicité"; font-family: var(--font-mono); font-size: .62rem;
    letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .3rem;
}

/* ------------------------------------------------------------ 13. Pied */

.site-footer {
    margin-top: clamp(3rem, 7vw, 5rem);
    border-top: 2px solid var(--ink);
    background: var(--paper-2);
    padding-block: 2.5rem 2rem;
}
.site-footer__grid {
    display: grid; gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
.site-footer h3 {
    font-size: .78rem; font-family: var(--font-mono); font-weight: 400;
    letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .8rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--orange); }
.site-footer__legal {
    margin-top: 2rem; padding-top: 1.2rem; border-top: 1px dashed var(--line-strong);
    display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
    font-size: .78rem; color: var(--ink-3);
}

/* -------------------------------------------------- 14. Bandeau cookies

   Une étiquette d'atelier posée dans le coin : assez visible pour qu'on y
   réponde, assez discrète pour ne pas masquer la première fiche. Les deux
   boutons ont le même poids — un « Refuser » qu'on doit chercher n'est pas
   un choix libre.
   ------------------------------------------------------------------------- */

.consent {
    position: fixed; z-index: 60;
    left: var(--gutter); right: var(--gutter);
    bottom: calc(1rem + env(safe-area-inset-bottom));
    display: flex; justify-content: flex-start; pointer-events: none;
}
.consent[hidden] { display: none; }

.consent__sheet {
    pointer-events: auto;
    position: relative;
    width: min(30rem, 100%);
    padding: 1.15rem 1.25rem 1.05rem;
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateY(calc(100% + 2rem)) rotate(-.6deg);
    opacity: 0;
    transition: transform .42s cubic-bezier(.22, 1, .36, 1), opacity .3s ease;
}
.consent.is-open .consent__sheet { transform: none; opacity: 1; }

/* Le ruban adhésif qui tient l'étiquette au coin de l'écran. */
.consent__sheet::before {
    content: ""; position: absolute; top: -.7rem; left: 1.6rem;
    width: 4.5rem; height: 1.4rem;
    background: color-mix(in srgb, var(--yellow) 55%, transparent);
    border: 1px solid color-mix(in srgb, var(--wood-line) 30%, transparent);
    transform: rotate(-4deg);
}

.consent__label {
    margin: 0 0 .35rem; font-family: var(--font-mono);
    font-size: .66rem; letter-spacing: .14em; text-transform: uppercase;
    color: var(--ink-3);
}
.consent__title {
    margin: 0 0 .45rem; font-family: var(--font-display);
    font-size: 1.18rem; font-weight: 700; line-height: 1.2;
}
.consent__text {
    margin: 0 0 .95rem; font-size: .9rem; line-height: 1.5; color: var(--ink-2);
}
.consent__text strong { color: var(--ink); }

.consent__actions { display: flex; gap: .6rem; }
.consent__btn {
    flex: 1 1 0; min-height: 2.7rem; padding: .5rem 1rem;
    font-family: var(--font-display); font-size: .95rem; font-weight: 700;
    color: var(--ink); background: var(--paper-2);
    border: 2px solid var(--ink); border-radius: 10px;
    cursor: pointer; transition: transform .12s ease, background .18s ease;
}
.consent__btn:hover { background: var(--paper-3); }
.consent__btn:active { transform: translateY(1px); }
.consent__btn--yes { background: var(--orange); border-color: var(--orange); color: #fff; }
.consent__btn--yes:hover { background: var(--orange-dark); border-color: var(--orange-dark); }

.consent__more {
    display: inline-block; margin-top: .7rem;
    font-family: var(--font-mono); font-size: .7rem; color: var(--ink-3);
}
.consent__more:hover { color: var(--orange); }

/* La barre d'achat mobile et le bandeau visent le même coin : on empile. */
@media (max-width: 52rem) {
    .page-fiche .consent { bottom: calc(4.6rem + env(safe-area-inset-bottom)); }
}

/* Rappel du choix, sur la page confidentialité. */
.consent-state {
    display: flex; flex-wrap: wrap; align-items: center; gap: .8rem;
    margin-top: .6rem; padding: .9rem 1.1rem;
    background: var(--paper-2); border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
}
.consent-state p { margin: 0; font-size: .88rem; }
.consent-state button {
    font-family: var(--font-display); font-weight: 700; font-size: .85rem;
    padding: .45rem .9rem; cursor: pointer;
    color: var(--ink); background: var(--card);
    border: 2px solid var(--ink); border-radius: 9px;
}
.consent-state button:hover { background: var(--ink); color: var(--paper); }

/* --------------------------------------------------------- 15. Mouvement */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    .site-header, .site-footer, .sticky-cta, .search, .ad, .related, .consent { display: none !important; }
    body { background: #fff; color: #000; }
    .shop { break-inside: avoid; }
}
