/* 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;
    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;
    }
}
/* 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-light);
    --color-stroke: var(--color-light);
    --color-background: var(--color-dark);

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

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

    --size-step-0: clamp(1rem, calc(0.96rem + 0.22vw), 1.13rem);
    --size-step-1: clamp(1.25rem, calc(1.16rem + 0.43vw), 1.5rem);
    --size-step-2: clamp(1.56rem, calc(1.41rem + 0.76vw), 2rem);
    --size-step-3: clamp(1.95rem, calc(1.71rem + 1.24vw), 2.66rem);
    --size-step-4: clamp(2.44rem, calc(2.05rem + 1.93vw), 3.55rem);

    --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);

    --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:not(:focus):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(--size-step-0);
    font-family: var(--font-family-primary);
    line-height: 1.7;

    min-height: 100vh;
    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;
}

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

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

h3 {
    font-size: var(--size-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(--size-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: var(--color-accent);

    border: none;
    padding: var(--space-xs) 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(--size-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: 0.3em solid var(--color-stroke);
    padding-block: var(--space-m);

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

footer {
    border-block-start: 0.3em solid var(--color-stroke);
    padding-block: var(--space-m);
}

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

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