/*
    Flex Hub design tokens.

    Stylesheets use a custom property from here for any value this file covers. Shell names shared
    with the sister apps come from the Flex shell spec and are the shared vocabulary, so they are
    not renamed.
*/

/*
    Fonts are self-hosted for offline plant networks. Space Grotesk and IBM Plex Sans use variable
    font files. IBM Plex Mono uses one file per weight. See fonts/LICENSE.txt.
*/

@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url("/fonts/space-grotesk-latin.woff2") format("woff2");
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("/fonts/ibm-plex-sans-latin.woff2") format("woff2");
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/ibm-plex-sans-italic-latin.woff2") format("woff2");
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("/fonts/ibm-plex-mono-600-latin.woff2") format("woff2");
}

:root {

    /* Tells the browser to draw its own controls and scrollbars dark. */
    color-scheme: dark;

    /* ---- Surfaces ---- */
    --surface-login: #0d0f12;
    --surface-nav: #111316;
    --surface-body: #1b1e23;
    --surface-dock: #1e2228;
    --surface-card: #22262c;
    --surface-recessed: #191c21;
    --surface-flex: #161a1e;
    --surface-raised: #2a2f37;

    /* Active navigation background. The shared shell name, mapped to the body surface. */
    --surface-nav-active: var(--surface-body);

    /* ---- Borders ---- */
    --border-structural: #31363d;
    --border-card: #33383f;
    --border-input: #3a4048;

    /* ---- Text ---- */
    --text-primary: #e8e6e1;
    --text-body: #c5c8cd;
    --text-secondary: #9aa0a8;
    --text-tertiary: #8b9099;
    --text-muted: #71767d;
    --text-disabled: #5c6169;

    /* Navigation item text colors by state. Shared names, values are this app's own text scale. */
    --nav-item: var(--text-secondary);
    --nav-item-hover: var(--text-body);
    --nav-item-active: var(--text-primary);

    /* ---- Brand ---- */
    --accent: #e2703a;
    --accent-keyline-soft: rgba(226, 112, 58, .45);
    --accent-keyline-strong: rgba(226, 112, 58, .55);
    --accent-fill-soft: rgba(226, 112, 58, .07);
    --accent-fill-strong: rgba(226, 112, 58, .16);
    --accent-on-fill: #ffffff;

    /* Teal is the brand secondary, used for the lockup subtitle, links and the login mark, never as a background. */
    --teal: #6fd0c0;
    --avatar: #2f4a52;
    --avatar-text: #bfeee4;

    /* ---- Equipment states ---- */
    --state-run: #33ad67;
    --state-run-on-chip: #08210f;
    --state-run-pill-fill: rgba(51, 173, 103, .14);
    --state-run-pill-text: #7fc79c;

    --state-d1: #e04b4b;
    --state-d1-on-chip: #ffffff;
    --state-d1-pill-fill: rgba(224, 75, 75, .14);
    --state-d1-pill-text: #e88b8b;

    --state-d2: #3d86d4;
    --state-d2-on-chip: #ffffff;
    --state-d2-pill-fill: rgba(61, 134, 212, .14);
    --state-d2-pill-text: #8fb8e0;

    --state-mr: #e0b341;
    --state-mr-on-chip: #1b1207;
    --state-mr-pill-fill: rgba(224, 179, 65, .14);
    --state-mr-pill-text: #dcc182;

    /* Integrated feed lost. The only non-equipment value allowed in the chip slot. */
    --state-nodata-text: #a7cbe6;
    --state-nodata-fill: rgba(167, 203, 230, .08);
    --state-nodata-border: rgba(167, 203, 230, .4);

    /* Standalone with no state logged yet. Never an assumed RUN. */
    --state-notset-text: #8b9099;
    --state-notset-fill: transparent;
    --state-notset-border: #3a4048;

    /* ---- Insight severity ---- */
    --severity-critical: #e2703a;
    --severity-critical-on-badge: #ffffff;
    --severity-warning-text: #d8bd82;
    --severity-warning-border: #665a3a;
    --severity-warning-keyline: #b89a58;
    --severity-warning-label-mobile: #e0b341;
    --severity-info: #a7cbe6;
    --severity-info-text: #a7cbe6;
    --severity-info-border: rgba(167, 203, 230, .38);

    /* Summary metrics are text only, tinted per state. */
    --metric-run: #63e6a0;
    --metric-d1: #ff9a9a;
    --metric-d2: #7fb4f0;
    --metric-mr: #f2ce6b;

    /* Handoff tags, keyline chips inside Flex cards. */
    --tag-recurring-text: #ff9a9a;
    --tag-recurring-fill: rgba(224, 75, 75, .14);
    --tag-todo-text: #f2ce6b;
    --tag-todo-fill: rgba(224, 179, 65, .13);

    /* ---- Connection states ---- */
    --system-blue: #a7cbe6;
    --system-blue-fill: rgba(167, 203, 230, .08);
    --system-blue-keyline: rgba(167, 203, 230, .38);
    --system-blue-title: #c8dced;
    --comment-icon: #8fb8e0;

    /* ---- Form errors ---- */
    --error-text: #e88b8b;
    --error-keyline: rgba(224, 75, 75, .42);
    --error-fill: rgba(224, 75, 75, .09);
    --error-sub: #a58a8a;
    --error-field-keyline: rgba(224, 75, 75, .55);

    /* ---- Connected indicator ---- */
    --connected-text: #5fbf85;
    --connected-dot: #33ad67;
    --connected-halo: rgba(51, 173, 103, .16);

    /* ---- Font families ---- */
    --font-display: 'Space Grotesk', sans-serif;
    --font-ui: 'IBM Plex Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    /* ---- Type roles ---- */
    /* Letter spacing is separate because the font shorthand cannot carry it. */
    --font-nav-wordmark: 700 20px var(--font-display);
    --font-nav-wordmark-mobile: 700 18px var(--font-display);
    /* The app bar carries the name alone, with no subtitle under it, so it is set larger. */
    --font-nav-wordmark-appbar: 700 20px var(--font-display);
    --font-nav-wordmark-login: 700 26px var(--font-display);
    --font-nav-wordmark-login-mobile: 700 22px var(--font-display);
    --tracking-wordmark: -.02em;

    --font-page-title: 600 24px var(--font-display);
    --font-page-title-mobile: 600 19px var(--font-display);
    --font-section-heading: 600 27px var(--font-display);
    --font-login-headline: 600 35px var(--font-display);
    --font-login-headline-mobile: 600 27px var(--font-display);
    --tracking-title: -.025em;

    /* Dialog titles are UI scale on both platforms, not display type. */
    --font-dialog-title: 600 15px var(--font-ui);

    --font-card-title: 600 12.5px var(--font-ui);
    --font-card-title-large: 600 15px var(--font-ui);
    --font-card-title-mobile: 600 13px var(--font-ui);

    --font-body: 400 12.5px/1.55 var(--font-ui);
    --font-body-mobile: 400 13px/1.55 var(--font-ui);

    --font-field-label: 600 10px var(--font-mono);
    --tracking-field-label: .06em;
    --tracking-field-label-wide: .08em;

    --font-data: 400 10px var(--font-mono);
    --font-data-strong: 600 10px var(--font-mono);
    --font-data-strong-mobile: 600 11px var(--font-mono);
    --font-data-large: 600 12px var(--font-mono);
    --font-meta-mobile: 400 11.5px var(--font-mono);

    --font-button: 600 13px var(--font-ui);
    --font-button-mobile: 600 15px var(--font-ui);
    --font-button-mobile-large: 600 16px var(--font-ui);

    --font-nav-item: 500 14px var(--font-ui);
    --font-nav-item-active: 600 14px var(--font-ui);

    /* The account menu rows are set smaller than the rail items. */
    --font-account-menu-item: 500 13px var(--font-ui);

    --font-nav-item-mobile: 500 14px var(--font-ui);
    --font-nav-item-mobile-active: 600 14px var(--font-ui);

    /* ---- Radii ---- */
    /* Six shared radius names. Older names below them are aliases kept until their last uses move. */
    --radius-chip: 4px;
    --radius-control: 6px;
    --radius-field: 8px;
    --radius-card: 10px;
    --radius-panel: 12px;
    --radius-dialog: 14px;

    --radius-pill: 5px;
    --radius-control-large: var(--radius-field);
    --radius-button-desktop: var(--radius-field);
    --radius-card-large: 11px;
    --radius-field-mobile: 10px;
    --radius-panel-large: var(--radius-dialog);
    --keyline-severity-width: 3px;

    /* ---- Sizes ---- */
    --size-feed-icon-desktop: 34px;
    --size-feed-icon-mobile: 30px;
    --size-feed-icon-nested: 28px;
    --size-hit-target-min: 44px;
    --size-hit-target-gloves: 54px;
    --size-field-mobile: 52px;
    --size-button-mobile: 56px;
    --size-drawer-nav-item: 52px;
    --size-ptt-bar-mobile: 70px;
    --size-ptt-mic-mobile: 46px;

    /* Thread connector between feed icon centers. */
    --thread-connector: repeating-linear-gradient(#33383f 0 3px, transparent 3px 6px);
    --thread-connector-width: 2px;

    /* ---- Shell metrics ---- */
    /* Nav rail, one component with a collapsed and an expanded state. */
    --nav-width-collapsed: 64px;
    --nav-width-expanded: 212px;
    --nav-sidebar-width: var(--nav-width-expanded);         /* Older name, kept as an alias of the expanded width. */
    --nav-head: 56px;
    --nav-row: 62px;

    --drawer-width: 302px;
    --dock-tile-height: 54px;
    --design-canvas-desktop: 1360px;
    --design-canvas-mobile: 390px;

    /*
        One structural breakpoint at 900px. Media queries cannot read a custom property, so the
        900px literal is repeated in the media query in shell.css. This token is the record of it.
    */
    --breakpoint-structural: 900px;

    /* ---- Drawer, navigation and auth values ---- */
    --surface-drawer: #15181c;                              /* Drawer panel */
    --scrim: rgba(8, 10, 12, .62);                          /* Drawer scrim */
    --nav-divider: #2a2f37;                                 /* Sidebar dividers */
    --drawer-divider: #2a2f36;                              /* Drawer dividers */

    --accent-fill-nav-active: rgba(226, 112, 58, .11);      /* Active drawer item */
    --accent-keyline-nav-active: rgba(226, 112, 58, .4);    /* Active drawer item */
    --text-nav-active-mobile: #f0ece7;                      /* Active drawer label */
    --text-logout: #e08a8a;                                 /* Log out row */
    --text-drawer-logout: #a8b0b8;                          /* Drawer log out row */
    --text-drawer-footer: #4e535a;                          /* Drawer footer */

    /* The brand lockup is locked. These are its own type sizes. */
    --font-lockup-subtitle: 600 8px var(--font-mono);
    --tracking-lockup-subtitle: .18em;
    --font-drawer-name: 600 15.5px var(--font-ui);
    --font-drawer-group-label: 600 9.5px var(--font-mono);
    --tracking-drawer-group-label: .14em;

    /* The auth screens sit on their own near-black field, with their own card and heading tints. */
    --surface-login-card: #14181c;                          /* Login card */
    --border-login-card: #262b31;                           /* Login card */
    --text-login-heading: #eef1f0;                          /* Wordmark and headline */
    --text-login-subhead: #a8bcbc;                          /* Strapline */
    --login-spotlight: radial-gradient(ellipse at center, rgba(20, 66, 74, .98), rgba(16, 50, 56, .4) 45%, rgba(13, 15, 18, 0) 72%);
    --shadow-login-card: 0 24px 60px -24px rgba(0, 0, 0, .8);
    --shadow-dialog: 0 24px 70px -20px rgba(0, 0, 0, .75);
    --shadow-menu: 0 8px 24px rgba(0, 0, 0, .45);           /* Sidebar account menu */
}
