/*
 * Linvoce design tokens. Loaded before every other stylesheet.
 *
 * Every colour in the app comes from one of these names, so the whole look
 * can be changed here (and a dark mode added) without touching other files.
 * Brand: ocean blue #127CB5 for actions, deep indigo #193780 for headings.
 */

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
    src: url("/static/fonts/nunito-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, 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: 200 1000;
    font-display: swap;
    src: url("/static/fonts/nunito-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
        U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
        U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Surfaces: page, cards, inputs and hover fills */
    --bg: #f5f8fc;
    --surface: #ffffff;
    --surface-2: #f2f6fa;
    --surface-3: #e9f0f7;

    /* Lines: card borders, dividers, empty progress tracks */
    --line: #e1e8f0;
    --line-strong: #cbd5e1;
    --track: #e1e8f0;

    /* Text */
    --ink: #14213d;
    --ink-2: #33415c;
    --muted: #5d6a80;
    --faint: #66728a;          /* 4.5:1 on the page background (was #8b96a8) */

    /* Brand */
    --primary: #127cb5;
    --primary-hover: #0f6ea3;  /* hover darkens, so white text stays readable (was #1a8bc7) */
    --primary-dark: #0e6194;
    --primary-edge: #0d5583;
    --primary-tint: #e4f2fa;
    --primary-ink: #0d6699;
    --deep: #193780;
    --deep-edge: #0f2360;

    /* Meaning: right, wrong, attention */
    --success: #20a866;
    --success-edge: #16824e;
    --success-tint: #e2f6eb;
    --success-ink: #127543;
    --danger: #d63a40;         /* white text on it: 4.6:1 (was #e5484d) */
    --danger-edge: #b93338;
    --danger-tint: #fdeceb;
    --danger-ink: #b0242b;
    --warning: #f5b400;
    --warning-edge: #c48c00;
    --warning-tint: #fff5d6;
    --warning-ink: #855600;

    /* Extra accents for categories */
    --orange: #f28c28;
    --orange-tint: #fff0e0;
    --orange-ink: #a35200;
    --violet: #6d5bd0;
    --violet-tint: #efecfc;
    --violet-ink: #5140b5;

    --on-color: #ffffff;

    /* See-through fills for hovering and the frosted header */
    --hover-fill: rgba(22, 33, 62, 0.08);
    --hover-fill-strong: rgba(22, 33, 62, 0.16);
    --hover-fill-soft: rgba(22, 33, 62, 0.04);
    --glass: rgba(255, 255, 255, 0.92);

    color-scheme: light;

    /* Shape and type */
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --edge: 4px;
    --font: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ===== Dark mode =====
   Follows the device's setting, unless the learner picked Light or Dark in
   Settings (theme-init.js sets data-theme on <html>). The two blocks below
   must stay the same. */

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        /* Surfaces */
        --bg: #0e1524;
        --surface: #161f33;
        --surface-2: #1c2740;
        --surface-3: #23304d;

        /* Lines */
        --line: #2a3754;
        --line-strong: #3b4b6c;
        --track: #2a3754;

        /* Text */
        --ink: #e7edf7;
        --ink-2: #c3cee0;
        --muted: #94a2ba;
        --faint: #8a98b2;          /* 4.5:1 on cards (was #6d7b95) */

        /* Brand (a little lighter, so it stands out on dark) */
        --primary: #1a7db5;        /* white text on buttons: 4.5:1 (was #1f8fcc) */
        --primary-hover: #176fa3;  /* hover darkens, so white text stays readable (was #2a9fdc) */
        --primary-dark: #1678b0;
        --primary-edge: #0d5583;
        --primary-tint: #13324a;
        --primary-ink: #6cc3f0;
        --deep: #b4c8ff;
        --deep-edge: #0f2360;

        /* Meaning */
        --success: #2bb673;
        --success-edge: #1b8551;
        --success-tint: #12372a;
        --success-ink: #6fdca5;
        --danger: #d63a40;         /* white text on it: 4.6:1 (was #ef5a5f) */
        --danger-edge: #b93338;
        --danger-tint: #3d1a1e;
        --danger-ink: #ff9a9d;
        --warning: #f5b400;
        --warning-edge: #b38300;
        --warning-tint: #3a300d;
        --warning-ink: #f3cc5a;

        /* Category accents */
        --orange: #f28c28;
        --orange-tint: #3b2612;
        --orange-ink: #ffb46b;
        --violet: #8a7be6;
        --violet-tint: #27224b;
        --violet-ink: #b9aeff;

        --hover-fill: rgba(255, 255, 255, 0.08);
        --hover-fill-strong: rgba(255, 255, 255, 0.16);
        --hover-fill-soft: rgba(255, 255, 255, 0.04);
        --glass: rgba(14, 21, 36, 0.9);

        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    /* Surfaces */
    --bg: #0e1524;
    --surface: #161f33;
    --surface-2: #1c2740;
    --surface-3: #23304d;

    /* Lines */
    --line: #2a3754;
    --line-strong: #3b4b6c;
    --track: #2a3754;

    /* Text */
    --ink: #e7edf7;
    --ink-2: #c3cee0;
    --muted: #94a2ba;
    --faint: #8a98b2;          /* 4.5:1 on cards (was #6d7b95) */

    /* Brand (a little lighter, so it stands out on dark) */
    --primary: #1a7db5;        /* white text on buttons: 4.5:1 (was #1f8fcc) */
    --primary-hover: #176fa3;  /* hover darkens, so white text stays readable (was #2a9fdc) */
    --primary-dark: #1678b0;
    --primary-edge: #0d5583;
    --primary-tint: #13324a;
    --primary-ink: #6cc3f0;
    --deep: #b4c8ff;
    --deep-edge: #0f2360;

    /* Meaning */
    --success: #2bb673;
    --success-edge: #1b8551;
    --success-tint: #12372a;
    --success-ink: #6fdca5;
    --danger: #d63a40;         /* white text on it: 4.6:1 (was #ef5a5f) */
    --danger-edge: #b93338;
    --danger-tint: #3d1a1e;
    --danger-ink: #ff9a9d;
    --warning: #f5b400;
    --warning-edge: #b38300;
    --warning-tint: #3a300d;
    --warning-ink: #f3cc5a;

    /* Category accents */
    --orange: #f28c28;
    --orange-tint: #3b2612;
    --orange-ink: #ffb46b;
    --violet: #8a7be6;
    --violet-tint: #27224b;
    --violet-ink: #b9aeff;

    --hover-fill: rgba(255, 255, 255, 0.08);
    --hover-fill-strong: rgba(255, 255, 255, 0.16);
    --hover-fill-soft: rgba(255, 255, 255, 0.04);
    --glass: rgba(14, 21, 36, 0.9);

    color-scheme: dark;
}
