/* ==========================================================
   ildivorzista — TYPOGRAPHY
   Versione 1.1
========================================================== */

html {
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;

    color: var(--text-body);
    background: var(--background);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    font-size: 1rem;
    font-weight: 400;
    line-height: 1.65;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    text-rendering: optimizeLegibility;
}

/* ==========================================================
   HEADINGS
========================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;

    color: var(--text-title);

    font-weight: 780;
    line-height: 1.1;
    letter-spacing: -0.03em;

    text-wrap: balance;
}

h1 {
    font-size: clamp(2.8rem, 5vw, 5rem);
}

h2 {
    font-size: clamp(2rem, 3.4vw, 3.4rem);
}

h3 {
    font-size: clamp(1.25rem, 2vw, 1.55rem);
}

h4 {
    font-size: 1.2rem;
}

h5 {
    font-size: 1.05rem;
}

h6 {
    font-size: 0.95rem;
}

/* ==========================================================
   TEXT
========================================================== */

p {
    margin-top: 0;

    color: inherit;

    text-wrap: pretty;
}

strong,
b {
    font-weight: 750;
}

small {
    font-size: 0.875em;
}

/* ==========================================================
   LINKS
========================================================== */

a {
    color: var(--color-primary);

    text-decoration: none;

    transition:
        color 200ms ease;
}

a:hover {
    color: var(--color-primary-dark);
}

a:focus-visible {
    outline: 3px solid rgb(110 91 255 / 24%);
    outline-offset: 4px;
    border-radius: 3px;
}

/* ==========================================================
   LISTS
========================================================== */

ul,
ol {
    margin-top: 0;
}

li {
    text-wrap: pretty;
}

/* ==========================================================
   FORM ELEMENTS
========================================================== */

button,
input,
textarea,
select {
    font: inherit;
}

button {
    color: inherit;
}

/* ==========================================================
   SELECTION
========================================================== */

::selection {
    color: var(--white);
    background: var(--color-primary);
}

/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 640px) {
    body {
        font-size: 0.975rem;
        line-height: 1.62;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        line-height: 1.08;
        letter-spacing: -0.028em;
    }

    h1 {
        font-size: clamp(2.4rem, 12vw, 3.5rem);
    }

    h2 {
        font-size: clamp(1.9rem, 9vw, 2.8rem);
    }

    h3 {
        font-size: 1.25rem;
    }
}

/* ==========================================================
   ACCESSIBILITY
========================================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    a {
        transition: none;
    }
}