/*
 * SignalHop design tokens (ADR 0012).
 *
 * Neutral grays and one indigo accent. Green, red and amber are only for trade and
 * connection status. <html data-theme="light|dark|system"> picks the palette; the
 * server sets it from the tr_theme cookie so the page never flashes the wrong theme.
 */

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;

    --radius-control: 8px;
    --radius-card: 12px;
    --sidebar-width: 232px;
    --rail-width: 68px;

    color-scheme: light;
    --bg: #F7F7F8;
    --surface: #FFFFFF;
    --surface-2: #F1F1F4;
    --border: #E4E4E8;
    --text: #17171C;
    --text-2: #4B4B55;
    --text-3: #6B6B76;
    --accent: #4F46E5;
    --accent-fg: #FFFFFF;
    --accent-soft: #EEF0FF;
    --accent-text: #4338CA;
    --pos: #15803D;
    --pos-soft: #EDFAF1;
    --neg: #B91C1C;
    --neg-soft: #FDF0F0;
    --warn: #A35200;
    --warn-soft: #FFF6E5;
    --focus: #4F46E5;
}

/* Dark palette: chosen explicitly, or "system" on a device set to dark. Keep the two
   blocks identical. */
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0C0C0F;
    --surface: #141418;
    --surface-2: #1D1D23;
    --border: #2B2B33;
    --text: #F2F2F4;
    --text-2: #B4B4BD;
    --text-3: #8E8E99;
    --accent: #8B93FF;
    --accent-fg: #0C0C0F;
    --accent-soft: #1F1F45;
    --accent-text: #AEB4FF;
    --pos: #4ADE80;
    --pos-soft: #102619;
    --neg: #FF8A8A;
    --neg-soft: #2C1416;
    --warn: #F5B94A;
    --warn-soft: #2A2111;
    --focus: #AEB4FF;
}

@media (prefers-color-scheme: dark) {
    [data-theme="system"] {
        color-scheme: dark;
        --bg: #0C0C0F;
        --surface: #141418;
        --surface-2: #1D1D23;
        --border: #2B2B33;
        --text: #F2F2F4;
        --text-2: #B4B4BD;
        --text-3: #8E8E99;
        --accent: #8B93FF;
        --accent-fg: #0C0C0F;
        --accent-soft: #1F1F45;
        --accent-text: #AEB4FF;
        --pos: #4ADE80;
        --pos-soft: #102619;
        --neg: #FF8A8A;
        --neg-soft: #2C1416;
        --warn: #F5B94A;
        --warn-soft: #2A2111;
        --focus: #AEB4FF;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
}

h1, h2, h3, h4, p {
    margin: 0;
}

a {
    color: var(--accent-text);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

code,
pre,
.mono {
    font-family: var(--font-mono);
    font-size: 12.5px;
}

/* The hidden attribute always wins over component display rules. */
[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
