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

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
    margin: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
    list-style: none;
}

/* Set core root defaults */
html:focus-within {
    scroll-behavior: smooth;
}

html {
    overflow-y: scroll;
}

@supports (scrollbar-gutter: stable) {
    html {
        overflow-y: auto;
        scrollbar-gutter: stable;
    }
}

/* Set core body defaults */
body {
    min-height: 100vh;
    min-height: 100svh;
    text-rendering: optimizeSpeed;
    line-height: 1.5;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
    text-decoration-skip-ink: auto;
}

/* Make images easier to work with */
img,
picture {
    max-width: 100%;
    display: block;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
    font: inherit;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}
/* Design tokens, size steps use Utopia type scales */
:root {
    --color-dark: #003e25;
    --color-light: #e3cce4;
    --color-light2: #e6ccba;
    --color-accent: #df3c2f;

    --color-text: var(--color-dark);
    --color-stroke: var(--color-dark);
    --color-background: var(--color-light);

    --font-family-serif: Georgia, serif;
    --font-family-sans-serif: sans-serif;

    --font-family-primary: var(--font-family-serif);
    --font-family-title: var(--font-family-sans-serif);

    --step-0: clamp(1.125rem, 1.0739rem + 0.2273vw, 1.25rem);
    --step-1: clamp(1.4996rem, 1.39rem + 0.487vw, 1.7675rem);
    --step-2: clamp(1.999rem, 1.7944rem + 0.9095vw, 2.4992rem);
    --step-3: clamp(2.6647rem, 2.3091rem + 1.5805vw, 3.5339rem);
    --step-4: clamp(3.552rem, 2.9609rem + 2.6272vw, 4.997rem);
    --step-5: clamp(4.7348rem, 3.7813rem + 4.238vw, 7.0657rem);

    --space-3xs: clamp(0.3125rem, 0.3125rem + 0vw, 0.3125rem);
    --space-2xs: clamp(0.5625rem, 0.5369rem + 0.1136vw, 0.625rem);
    --space-xs: clamp(0.875rem, 0.8494rem + 0.1136vw, 0.9375rem);
    --space-s: clamp(1.125rem, 1.0739rem + 0.2273vw, 1.25rem);
    --space-m: clamp(1.6875rem, 1.6108rem + 0.3409vw, 1.875rem);
    --space-l: clamp(2.25rem, 2.1477rem + 0.4545vw, 2.5rem);
    --space-xl: clamp(3.375rem, 3.2216rem + 0.6818vw, 3.75rem);
    --space-2xl: clamp(4.5rem, 4.2955rem + 0.9091vw, 5rem);
    --space-3xl: clamp(6.75rem, 6.4432rem + 1.3636vw, 7.5rem);

    --gutter: var(--space-s);
    --wrapper-max-width: calc(1400px + 2 * var(--gutter));
}

@view-transition {
    navigation: auto;
}

/* https://www.a11yproject.com/posts/how-to-hide-content/ */
.visually-hidden-unless-focus-within:not(:focus-within):not(:active) {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

html {
    font-size: 120%;
}

/* Typography base elements style */
body {
    background: var(--color-background);
    color: var(--color-text);

    font-size: var(--step-0);
    font-family: var(--font-family-primary);
    line-height: 1.7;

    display: flex;
    flex-direction: column;
    row-gap: var(--space-s);

    text-transform: lowercase;
}

main {
    flex-grow: 1;
}

h1,
h2,
h3 {
    font-family: var(--font-family-title);
    font-weight: 800;
    line-height: 1.1;
    text-wrap: balance;
    word-break: break-word;
}

h1 {
    font-size: var(--step-3);
}

h2 {
    font-size: var(--step-2);
}

h3 {
    font-size: var(--step-1);
}

ul,
ol {
    padding-inline-start: 1em;
}

blockquote {
    padding-inline-start: 1em;
    border-inline-start: 0.3em solid;
    font-style: italic;
    font-size: var(--step-1);
}

a {
    color: currentColor;
    text-decoration-color: var(--color-accent);
    text-decoration-thickness: 0.3ex;
    text-underline-offset: 0.3ex;
}

a:has(> button) {
    display: flex;
}

button {
    color: var(--color-text);
    background: none;

    border: var(--space-2xs, 4px) solid var(--color-accent);
    padding: var(--space-2xs) var(--space-s);

    cursor: pointer;
    text-decoration: none;
}

/* Vertical spacing */
.flow > * + * {
    margin-block-start: var(--flow-space, 1em);
}

/* Horizontal spacing */
article {
    max-width: 65ch;
    margin-inline: auto;
}

blockquote {
    max-width: 50ch;
}

h1 {
    max-width: 20ch;
}

h2,
h3 {
    max-width: 28ch;
}

/* Intro element */
.lede {
    font-size: var(--step-1);
    font-style: italic;
    max-width: 50ch;
    text-wrap: balance;
}

.lede + * {
    --flow-space: 2em;
}

.wrapper {
    margin-inline: auto;
    width: 100%;
    padding-inline: var(--gutter);
    max-width: var(--wrapper-max-width);
}

.navigation-list {
    list-style: none;
    margin-block: 0;
    padding-inline-start: 0;
}

.cluster {
    display: flex;
    flex-wrap: wrap;
    flex-direction: var(--cluster-flex-direction, row);
    gap: var(--cluster-gap, var(--space-s));
    align-items: flex-start;
}

.header {
    border-block-end: var(--space-2xs, 4px) solid var(--color-stroke);
    padding-block: var(--space-m);

    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

footer {
    border-block-start: var(--space-2xs, 4px) solid var(--color-stroke);
    padding-block: var(--space-m);
}

#le-bouton {
    font-size: var(--step-2);
}

.color-accent {
    color: var(--color-accent);
}
body {
    --x: 0px;
    --y: 0px;

    @media (prefers-reduced-motion: no-preference) {
        --x: calc(var(--posX, 0) * 1px);
        --y: calc(var(--posY, 0) * 1px);
    }

    --gradient-base: var(--color-background);

    --tint-a: oklch(
        from var(--gradient-base) calc(l + 0.1) calc(c + 0.05) calc(h - 15)
    );
    --tint-b: oklch(
        from var(--gradient-base) calc(l - 0.05) calc(c + 0.05) calc(h + 15)
    );
    --tint-c: oklch(from var(--gradient-base) l calc(c + 0.07) calc(h + 30));
    --tint-d: oklch(from var(--gradient-base) calc(l - 0.08) c calc(h - 30));

    background-color: var(--gradient-base);
    background-image:
        radial-gradient(
            90% 100% at calc(50% + var(--x)) calc(0% + var(--y)),
            var(--tint-a),
            transparent
        ),
        radial-gradient(
            100% 100% at calc(80% - var(--x)) calc(0% - var(--y)),
            var(--tint-b),
            transparent
        ),
        radial-gradient(
            150% 210% at calc(100% + var(--x)) calc(0% + var(--y)),
            var(--tint-c),
            transparent
        ),
        radial-gradient(
            100% 100% at calc(100% - var(--x)) calc(30% - var(--y)),
            var(--tint-d),
            transparent
        ),
        linear-gradient(115deg, var(--tint-a), var(--tint-b));
}