/* =========================================================================
   grosamael.store : domotique et électronique, fait main.

   Identité volontairement distincte du portfolio grosamael.fr : ici c'est un
   atelier, pas une vitrine commerciale. Papier chaud, accent brique, titres
   en serif. Même grammaire visuelle en revanche : filets fins, libellés en
   mono, aucune carte encadrée.

   Tout passe par les variables : le mode sombre n'a aucune règle dédiée en
   dehors du bloc [data-theme="dark"].
   ========================================================================= */

:root {
    --bg: #faf8f5;
    --bg-alt: #f2eee8;
    --border: #e0d9cf;
    --border-strong: #c9bfb1;
    --text: #35312c;
    --text-heading: #1a1815;
    --text-muted: #6b645b;
    --text-light: #7a7166;
    --accent: #b03e12;
    --accent-soft: rgba(176, 62, 18, 0.09);
    --warn: #a8690b;
    --ok: #1f7a4d;

    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-title: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --container: 720px;
    --container-wide: 960px;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --bg: #14120f;
    --bg-alt: #1c1917;
    --border: #302a24;
    --border-strong: #463e35;
    --text: #ddd6cc;
    --text-heading: #f5f0e8;
    --text-muted: #9c9287;
    --text-light: #6e665c;
    --accent: #e8763f;
    --accent-soft: rgba(232, 118, 63, 0.12);
    --warn: #d99a2b;
    --ok: #4fb383;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.container-wide {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: var(--accent);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: #fff;
    padding: 0.6rem 1rem;
    z-index: 100;
}

.skip-link:focus {
    left: 0;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

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

.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.site-header .container-wide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
}

.logo {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-heading);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.logo span {
    color: var(--accent);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.site-nav a {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
    transition: color var(--transition), border-color var(--transition);
}

.site-nav a:hover,
.site-nav a[aria-current] {
    color: var(--text-heading);
    border-bottom-color: var(--accent);
}

.theme-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0.45rem 0.55rem;
    transition: border-color var(--transition), color var(--transition);
}

.theme-btn:hover {
    border-color: var(--border-strong);
    color: var(--text-heading);
}

/* --- Titres et texte -------------------------------------------------- */

h1,
h2,
h3 {
    font-family: var(--font-title);
    color: var(--text-heading);
    line-height: 1.25;
    letter-spacing: -0.015em;
    font-weight: 600;
}

h1 {
    font-size: clamp(2rem, 5vw, 2.8rem);
    margin: 0 0 1rem;
}

h2 {
    font-size: clamp(1.4rem, 3vw, 1.75rem);
    margin: 3.5rem 0 1rem;
}

h3 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
}

.eyebrow {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.9rem;
}

.lead {
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--text);
}

.muted {
    color: var(--text-muted);
}

main {
    padding: 3.5rem 0 4.5rem;
}

/* --- Fiche d'état du projet ------------------------------------------- */

.build-status {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2.5rem;
    margin: 2rem 0 0;
    padding: 1.15rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.build-status li {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
}

.build-status .k {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-light);
}

.build-status .v {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-heading);
}

/* --- Bandeau affiliation (obligation légale) -------------------------- */

.affiliate-note {
    margin: 2.5rem 0;
    padding-left: 1rem;
    border-left: 2px solid var(--accent);
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-muted);
}

.affiliate-note strong {
    color: var(--text-heading);
}

/* --- Liste des pièces ------------------------------------------------- */

.piece-list {
    list-style: none;
    counter-reset: piece;
    margin: 2rem 0 0;
    padding: 0;
}

.piece {
    counter-increment: piece;
    padding: 1.9rem 0;
    border-top: 1px solid var(--border);
}

.piece:last-child {
    border-bottom: 1px solid var(--border);
}

.piece-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

.piece-head h3 {
    margin: 0;
}

.piece-head h3::before {
    content: counter(piece, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-light);
    margin-right: 0.65rem;
}

.piece-price {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.piece p {
    margin: 0 0 0.8rem;
}

.piece .warn {
    font-size: 0.92rem;
    color: var(--text-muted);
    border-left: 2px solid var(--warn);
    padding-left: 0.9rem;
}

.piece .warn strong {
    color: var(--text-heading);
}

.buy-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition);
}

.buy-link:hover,
.buy-link:focus-visible {
    border-bottom-color: var(--accent);
}

.buy-link::after {
    content: "\2197";
    font-size: 0.85em;
}

/* --- Liste « ce qu'on n'achète pas là-bas » --------------------------- */

.avoid-list {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
}

.avoid-list li {
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
}

.avoid-list li:last-child {
    border-bottom: 1px solid var(--border);
}

.avoid-list p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Index des carnets ------------------------------------------------ */

.entry-list {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
}

.entry {
    padding: 1.75rem 0;
    border-top: 1px solid var(--border);
}

.entry:last-child {
    border-bottom: 1px solid var(--border);
}

.entry a {
    text-decoration: none;
}

.entry h3 {
    color: var(--text-heading);
    margin-bottom: 0.4rem;
    transition: color var(--transition);
}

.entry a:hover h3 {
    color: var(--accent);
}

.entry p {
    margin: 0 0 0.6rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-light);
}

.tag-live {
    color: var(--ok);
}

/* --- FAQ -------------------------------------------------------------- */

.faq details {
    border-top: 1px solid var(--border);
    padding: 1.1rem 0;
}

.faq details:last-of-type {
    border-bottom: 1px solid var(--border);
}

.faq summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-heading);
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "+";
    font-family: var(--font-mono);
    color: var(--accent);
    flex-shrink: 0;
}

.faq details[open] summary::after {
    content: "\2212";
}

.faq details > div {
    margin-top: 0.7rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

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

.site-footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.site-footer .container-wide {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
    justify-content: space-between;
    align-items: center;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.site-footer a:hover {
    color: var(--text-heading);
    border-bottom-color: var(--border-strong);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}

/* --- Pages légales ---------------------------------------------------- */

.legal h2 {
    font-size: 1.15rem;
    margin: 2.5rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.legal p,
.legal li {
    color: var(--text-muted);
    font-size: 0.95rem;
}

@media (max-width: 640px) {
    body {
        font-size: 16px;
    }

    .site-header .container-wide {
        flex-wrap: wrap;
    }

    .site-nav {
        gap: 1.1rem;
    }

    .piece-head {
        flex-direction: column;
        gap: 0.2rem;
    }

    .build-status {
        gap: 0.6rem 1.5rem;
    }
}

/* --- Listes d'outillage : même grammaire que .piece, sans lien d'achat. --- */

.tool-list {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
}

.tool-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.1rem 0;
    border-top: 1px solid var(--border);
}

.tool-list li:last-child {
    border-bottom: 1px solid var(--border);
}

.tool-list .t-name {
    font-weight: 600;
    color: var(--text-heading);
}

.tool-list .t-why {
    display: block;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.tool-list .t-price {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Encart d'alerte autoportant, hors liste. */
.note-warn {
    margin: 1.75rem 0;
    padding: 0.1rem 0 0.1rem 1rem;
    border-left: 2px solid var(--warn);
    font-size: 0.93rem;
    color: var(--text-muted);
}

.note-warn strong {
    color: var(--text-heading);
}

/* Récapitulatif de budget. */
.budget {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
}

.budget li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0;
    border-top: 1px solid var(--border);
    font-size: 0.95rem;
}

.budget li:last-child {
    border-top: 1px solid var(--border-strong);
    border-bottom: 1px solid var(--border-strong);
    font-weight: 600;
    color: var(--text-heading);
}

.budget .b-amount {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    white-space: nowrap;
}

/* Étapes du montage. */
.steps {
    list-style: none;
    counter-reset: step;
    margin: 2rem 0 0;
    padding: 0;
}

.steps li {
    counter-increment: step;
    padding: 1.4rem 0;
    border-top: 1px solid var(--border);
}

.steps li:last-child {
    border-bottom: 1px solid var(--border);
}

.steps h3::before {
    content: "Étape " counter(step);
    display: block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 0.3rem;
}

.steps p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}
