/* Staff site, 1 of 13: the tokens, light and dark. Loaded first; every file after it reads only these. */

/* ArcTerra staff site. Every colour comes from a token; the tokens come from the logo.
   See docs/brand.md for where each value was measured and why blue leads. */

:root {
    color-scheme: light dark;

    /* Brand - sampled from the logo */
    --brand-blue: #26556F;
    --brand-blue-deep: #1A3F55;
    --brand-blue-light: #3B718D;
    --brand-green: #4E7859;
    --brand-green-deep: #3C5F46;
    --brand-sage: #618263;
    --brand-navy: #0F2A3F;
    --brand-arc: linear-gradient(135deg, #26556F 0%, #3B718D 45%, #618263 78%, #4E7859 100%);

    /* Neutrals - cool, biased toward the logo's paper */
    --canvas: #F4F9FC;
    --surface: #FFFFFF;
    --well: #E9F0F5;
    --line: #D3DEE6;
    --line-soft: #E2EAF0;
    --ink: #14212B;
    --ink-2: #3E5060;
    --ink-3: #5E7282;
    --ink-on-brand: #FFFFFF;

    /* Status - outside the brand hues so a pill never reads as branding */
    --ok: #2F8A5B;        --ok-wash: #E1F2E8;      --ok-ink: #1E5C3D;
    --warn: #A8721C;      --warn-wash: #FBF0DA;    --warn-ink: #6E4A0E;
    --danger: #B0392E;    --danger-wash: #FBE8E5;  --danger-ink: #7F2820;
    --info: #26556F;      --info-wash: #E3EDF4;    --info-ink: #1A3F55;

    /* Sidebar - the arc turned vertical, navy into deep green */
    --sidebar-bg: linear-gradient(180deg, #0F2A3F 0%, #1A3F55 62%, #2F4E3E 100%);
    --sidebar-ink: #D6E3EC;
    --sidebar-muted: #8FA8BA;
    --sidebar-hover: rgba(255, 255, 255, .08);
    --sidebar-active: rgba(255, 255, 255, .16);

    --shadow: 0 1px 2px rgba(20, 33, 43, .06), 0 8px 24px -16px rgba(20, 33, 43, .25);
    --radius: 8px;
    /* Small print. Phones lift all three to the 14 px text floor in one place (the phone block at the end). */
    --fs-small: .85rem;
    --fs-smaller: .8rem;
    --fs-fine: .75rem;
    /* The select chevron, stroked in --ink (a data URI cannot read a token, so each scheme sets its own). */
    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2314212B' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

    /* Names the rest of the stylesheet grew up with. Kept as aliases so nothing else moves. */
    --bg: var(--canvas);
    --border: var(--line);
    --text: var(--ink);
    --muted: var(--ink-3);
    --primary: var(--brand-blue);
    --primary-deep: var(--brand-blue-deep);
    --primary-ink: var(--ink-on-brand);
}

/* Dark follows the device unless the page says otherwise. Only tokens change here - never rules.
   Screen only: paper is white, so a printed page keeps the light tokens whatever the device says. */
@media screen and (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --brand-blue: #6FA3C2;
        --brand-blue-deep: #8DB8D2;
        --brand-green: #86AE8F;
        --brand-green-deep: #A3C5AB;

        --canvas: #0C1820;
        --surface: #13232E;
        --well: #0F1D27;
        --line: #24394A;
        --line-soft: #1C2F3D;
        --ink: #E7EEF3;
        --ink-2: #B0C0CC;
        --ink-3: #7C909F;
        --ink-on-brand: #0C1820;

        --ok: #5DBB86;        --ok-wash: #14311F;      --ok-ink: #9FDDB7;
        --warn: #E0A64A;      --warn-wash: #2C2113;    --warn-ink: #F0C784;
        --danger: #E58072;    --danger-wash: #2E1815;  --danger-ink: #F3A89E;
        --info: #6FA3C2;      --info-wash: #16283A;    --info-ink: #B8D3E4;

        --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px -16px rgba(0, 0, 0, .8);
        --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23E7EEF3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }
}
/* The person's own choice (ThemeChoice, set on <html> by App.razor): the same dark tokens. Screen only, as above.
   color-scheme goes with it, or the parts the browser paints itself (a select's list, date pickers, scrollbars,
   autofill) would keep following the device and clash with the page. */
@media screen {
    :root[data-theme="light"] { color-scheme: light; }
    :root[data-theme="dark"] {
        color-scheme: dark;
        --brand-blue: #6FA3C2;
        --brand-blue-deep: #8DB8D2;
        --brand-green: #86AE8F;
        --brand-green-deep: #A3C5AB;

        --canvas: #0C1820;
        --surface: #13232E;
        --well: #0F1D27;
        --line: #24394A;
        --line-soft: #1C2F3D;
        --ink: #E7EEF3;
        --ink-2: #B0C0CC;
        --ink-3: #7C909F;
        --ink-on-brand: #0C1820;

        --ok: #5DBB86;        --ok-wash: #14311F;      --ok-ink: #9FDDB7;
        --warn: #E0A64A;      --warn-wash: #2C2113;    --warn-ink: #F0C784;
        --danger: #E58072;    --danger-wash: #2E1815;  --danger-ink: #F3A89E;
        --info: #6FA3C2;      --info-wash: #16283A;    --info-ink: #B8D3E4;

        --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px -16px rgba(0, 0, 0, .8);
        --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23E7EEF3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    }
}
