/* Nunito Font Family - Self-hosted for Privacy */
/* Improved with better browser compatibility and fallbacks */

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src:
        local("Nunito Regular"),
        local("Nunito-Regular"),
        url("../fonts/nunito-regular.ttf") format("truetype");
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
        U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src:
        local("Nunito Medium"),
        local("Nunito-Medium"),
        url("../fonts/nunito-semibold.ttf") format("truetype");
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
        U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src:
        local("Nunito SemiBold"),
        local("Nunito-SemiBold"),
        url("../fonts/nunito-semibold.ttf") format("truetype");
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
        U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src:
        local("Nunito Bold"),
        local("Nunito-Bold"),
        url("../fonts/nunito-bold.ttf") format("truetype");
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
        U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src:
        local("Nunito ExtraBold"),
        local("Nunito-ExtraBold"),
        url("../fonts/nunito-bold.ttf") format("truetype");
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
        U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src:
        local("Nunito Black"),
        local("Nunito-Black"),
        url("../fonts/nunito-bold.ttf") format("truetype");
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
        U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
        U+FEFF, U+FFFD;
}

/* CSS Custom Properties for easy font usage */
:root {
    --font-family-nunito:
        "Nunito", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
        "Roboto", "Helvetica Neue", Arial, sans-serif;
    --font-family-fallback:
        system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
        "Helvetica Neue", Arial, sans-serif;
}

/* Preload critical font weights for performance */
body {
    font-family: var(--font-family-nunito);
}

/* Font loading optimization - prevent FOIT (Flash of Invisible Text) */
.font-loading body {
    font-family: var(--font-family-fallback);
}

/* Ensure smooth fallbacks for different font weights */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-family-nunito);
    font-weight: 700;
}

.font-regular {
    font-weight: 400;
}
.font-medium {
    font-weight: 500;
}
.font-semibold {
    font-weight: 600;
}
.font-bold {
    font-weight: 700;
}
.font-extrabold {
    font-weight: 800;
}
.font-black {
    font-weight: 900;
}

/* Improve text rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1;
    font-kerning: normal;
}
