/* =====================================================================
   Agribanana — Base
   Reset moderne + typographie + primitives layout.
   Depend de tokens.css.
   ===================================================================== */

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

* { margin: 0; }

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    font-family: var(--font-body);
    font-weight: var(--fw-book);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;

    /* Grain de fibre subtil en fond — visible mais non bruyant. */
    background-image:
        radial-gradient(circle at 20% 10%, rgba(92, 59, 54, 0.025) 0, transparent 60%),
        radial-gradient(circle at 80% 90%, rgba(67, 177, 106, 0.020) 0, transparent 60%);
    background-attachment: fixed;
}

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

input, button, textarea, select { font: inherit; color: inherit; }

button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--dur-base) var(--ease-out);
}
a:hover { color: var(--color-accent-hover); }

ul, ol { padding-left: 1.25rem; }

/* --- Typographie --- */

/* Socle commun : Manrope. Porte h3-h6, qui restent des titres de travail
 * (fiches produit, formulaires, blocs denses) ou Rye deviendrait illisible. */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-body);
    font-weight: var(--fw-semi);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
    color: var(--color-heading);
}

/* Rye : uniquement les deux niveaux hauts, la ou la police a la place de
 * respirer. Graisse unique 400 => on la declare explicitement et on coupe la
 * synthese, sinon le navigateur fabrique un faux gras baveux sur les titres.
 * Tracking remis a zero : la chasse de Rye est deja tres large, le -0.02em
 * du socle collait les empattements. */
h1, h2 {
    font-family: var(--font-display);
    font-weight: var(--fw-book);
    font-synthesis: none;
    letter-spacing: var(--ls-normal);
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 {
    font-size: var(--fs-xl);
    font-weight: var(--fw-medium);
}
h4 {
    font-size: var(--fs-lg);
    font-weight: var(--fw-semi);
    letter-spacing: var(--ls-normal);
}

p { line-height: var(--lh-loose); }
p + p { margin-top: 1em; }

strong, b { font-weight: var(--fw-bold); }

small { font-size: var(--fs-sm); color: var(--color-text-muted); }

/* Baseline caps : intitules de section, "001 / Introduction" */
.eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    text-transform: uppercase;
    letter-spacing: var(--ls-caps);
    color: var(--color-text-muted);
}

/* Signature manuscrite (Playwrite VN) — ancrage humain et artisanal :
 * signature de Salimata, citation fondatrice, mention "fait a Dabou".
 *
 * Regles d'emploi, volontairement contraignantes :
 *  - une ou deux lignes maximum, jamais un paragraphe ;
 *  - jamais de text-transform: uppercase (les liaisons cursives cassent) ;
 *  - jamais de gras : la famille s'arrete a 400, la synthese est coupee.
 * La taille est relevee d'un cran car la hauteur d'x de la cursive est basse,
 * et l'interligne elargi pour laisser passer hampes et jambages. */
.signature {
    display: inline-block;
    font-family: var(--font-accent);
    font-weight: var(--fw-book);
    font-synthesis: none;
    text-transform: none;
    font-size: var(--fs-md);
    line-height: var(--lh-loose);
    letter-spacing: var(--ls-normal);
    color: var(--marron-brand);
}

/* Variante affichee, pour une accroche isolee en pleine largeur. */
.signature--lead {
    font-size: var(--fs-lg);
    color: var(--vert-dark);
}

/* Lead paragraph */
.lead {
    font-size: var(--fs-md);
    line-height: var(--lh-loose);
    color: var(--color-text);
    font-weight: var(--fw-book);
}

/* --- Accessibilite --- */

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

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

.skip-link {
    position: absolute;
    top: -40px; left: var(--gutter);
    background: var(--color-heading);
    color: var(--blanc-casse);
    padding: var(--space-3) var(--space-4);
    z-index: calc(var(--z-wa) + 1);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    text-decoration: none;
    font-weight: var(--fw-semi);
}
.skip-link:focus { top: 0; color: var(--blanc-casse); }

/* --- Primitives layout --- */

.container {
    width: 100%;
    max-width: var(--container-lg);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-xl { max-width: var(--container-xl); }

.section {
    padding-block: clamp(3rem, 6vw, 6rem);
}
.section-alt { background: var(--color-surface-alt); }
.section-dark { background: var(--marron-brand); color: var(--beige-fibre); }
.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4 { color: var(--beige-deep); }

.stack > * + * { margin-top: var(--stack-gap, var(--space-4)); }
.stack-sm > * + * { --stack-gap: var(--space-2); }
.stack-md > * + * { --stack-gap: var(--space-4); }
.stack-lg > * + * { --stack-gap: var(--space-6); }
.stack-xl > * + * { --stack-gap: var(--space-8); }

/* Grille responsive "auto-fit" simple */
.grid-auto {
    display: grid;
    gap: var(--space-5);
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

/* Ligne decorative de separation, marron soft */
hr.rule {
    border: 0;
    height: 1px;
    background: var(--color-border);
    margin-block: var(--space-6);
}

/* Texture decorative : barre de fibre (utilisable en section) */
.fiber-divider {
    height: 2px;
    background: linear-gradient(to right,
        transparent,
        var(--marron-soft) 20%,
        var(--marron-brand) 50%,
        var(--marron-soft) 80%,
        transparent);
    margin-block: var(--space-6);
}
