/*
  Chiwara brand tokens — the one place for colours, type, corners and spacing.
  Used by the public site (css/style.css), the signed-in website (css/app.css)
  and the phone app (companion-src imports this file into my/app.css).

  - Palette names (--navy-900 …) are the raw brand colours.
  - Everything else should use the meaning-based names (--bg, --ink, --primary …):
    they change in dark mode, the palette does not.
  - Dark mode: pages whose <html> has class "theme-auto" (the signed-in website
    and the app) follow the phone's dark setting. The public site stays light.
*/

/* Fonts are served from this site (/fonts/), not Google: faster, they work
   offline in the app, and no visitor's details go to a third party.
   Both are under the SIL Open Font License (fonts/LICENSE-*.txt). */
@font-face { font-family: 'Public Sans'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/public-sans-latin-wght-normal.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: 'Public Sans'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/public-sans-latin-ext-wght-normal.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; }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('../fonts/lora-latin-wght-normal.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: 'Lora'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('../fonts/lora-latin-ext-wght-normal.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; }
@font-face { font-family: 'Lora'; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url('../fonts/lora-latin-wght-italic.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: 'Lora'; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url('../fonts/lora-latin-ext-wght-italic.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 {
  /* ---- Palette (fixed) ---- */
  /* Classic navy (#1E3A5F): AA as white-on-navy and as navy-on-white — see README. */
  --navy-950: #14263E;
  --navy-900: #1E3A5F;
  --navy-800: #425A79;
  --navy-700: #667992;
  --blue-100: #E8EBEF;
  /* Neon mint (#6CF3B1): the interpreter path's equal-weight second colour. Never white text on it. */
  --mint-100: #D6FCE9;
  --mint-200: #6CF3B1;
  --cream-50: #F7F8FC;
  --cream-100: #ECEFF9;
  --cream-200: #DCE1F2;
  --bone-card: #FFFFFF;
  --ink-900: #14172B;
  --ink-700: #454A5E;
  --ink-600: #454A5E;
  --ink-400: #767C93;
  --border: #DCE1F2;
  --border-dark: rgba(255,255,255,0.14);
  --white: #FFFFFF;
  /* The Co-Pilot's moving gradient (same on the website and in the app). */
  --orb-mint: #6CF3B1; --orb-sky: #7FD4FF; --orb-violet: #B9A6FF; --orb-gold: #FFD27F;

  /* ---- Meaning-based colours (light) ---- */
  --bg: #F7F8FC;             /* page */
  --card: #FFFFFF;           /* cards, sheets, inputs */
  --sunken: #ECEFF9;         /* wells, segmented controls, chips */
  --ink: #14172B;            /* body text */
  --muted: #454A5E;          /* secondary text */
  --subtle: #767C93;         /* placeholders, hover borders */
  --line: #DCE1F2;           /* borders, dividers */
  --heading: #1E3A5F;        /* headings, key figures, brand */
  --primary: #1E3A5F;        /* main buttons, links, current tab */
  --primary-hover: #425A79;
  --on-primary: #FFFFFF;
  --feature: #1E3A5F;        /* navy panels that stay navy in dark mode */
  --on-feature: #FFFFFF;
  --accent: #6CF3B1;
  --on-accent: #14263E;
  --accent-soft: #D6FCE9;
  --accent-wash: #F3FEF8;
  --accent-ink: #0F6B43;
  --bar: #2F5E8F;
  --ok: #1E7D4C;      --ok-soft: #DEF3E7;     --ok-ink: #1E5C3A;     --ok-edge: #9FD4B5;     --on-ok: #FFFFFF;
  --warn: #8A5300;    --warn-soft: #FFF0D2;   --warn-ink: #6B4000;   --warn-edge: #E8C27A;
  --danger: #B3261E;  --danger-soft: #FBE6E4; --danger-ink: #8C1D18; --danger-edge: #E9B4AE; --on-danger: #FFFFFF;
  --danger-hover: #8C1D18;
  --off: #5B6178;     --off-soft: #ECEFF3;    --off-ink: #454A5E;
  --ring: #1E3A5F;
  --ring-on-dark: #6CF3B1;
  --focus-halo: #E8EBEF;
  --scrim: rgba(14, 22, 38, 0.55);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234B4E58' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");

  /* Your status (the interpreter's availability switch): green = Available,
     amber = asked to confirm, red = logged off / offline. */
  --status-on-bg: #1E7D4C;   --status-on-fg: #FFFFFF;   --status-on-edge: #1E7D4C;
  --status-ask-bg: #FFF0D2;  --status-ask-fg: #6B4000;  --status-ask-edge: #8A5300;
  --status-off-bg: #B3261E;  --status-off-fg: #FFFFFF;  --status-off-edge: #B3261E;
  --switch-track-on: rgba(255, 255, 255, 0.3);
  --switch-track-off: rgba(255, 255, 255, 0.3);

  --shadow: 0 10px 30px rgba(20, 23, 43, 0.10);
  --shadow-sm: 0 1px 2px rgba(23, 20, 18, 0.05), 0 1px 3px rgba(23, 20, 18, 0.07);
  --shadow-md: 0 8px 20px rgba(23, 20, 18, 0.08);
  --shadow-lg: 0 16px 40px rgba(23, 20, 18, 0.12);

  /* ---- Type ---- */
  /* Lora: page titles, big numbers and feature lines. Public Sans: everything else. */
  --display: 'Lora', Georgia, 'Times New Roman', serif;
  --body: 'Public Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* ---- Corners: 8 / 12 / 16 / 24 / round ---- */
  --radius-sm: 8px;     /* inputs, small chips, table cards on desktop */
  --radius-md: 12px;    /* buttons in groups, menus, list rows */
  --radius-lg: 16px;    /* cards */
  --radius-xl: 24px;    /* sheets, dialogs, big feature panels */
  --radius-full: 999px; /* pills and main buttons */

  /* ---- Spacing ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* ---- Older names kept for css/style.css ---- */
  --color-bg: var(--bg);
  --color-surface: var(--card);
  --color-text: var(--ink);
  --color-text-muted: var(--muted);
  --color-primary: var(--primary);
  --color-accent: var(--primary);
  --color-accent-hover: var(--primary-hover);
  --color-ring: var(--ring);
  --color-ring-on-dark: var(--ring-on-dark);
  --font-display: var(--display);
  --font-body: var(--body);
  --font-mono: var(--body);
  --success-600: var(--ok);
  --success-100: var(--ok-soft);
  --error-600: var(--danger);
  --error-100: var(--danger-soft);

  color-scheme: light;
}

/* ---- Dark (signed-in website and app only) ---- */
@media (prefers-color-scheme: dark) {
  :root.theme-auto:not([data-theme="light"]) {
    --bg: #0D1524; --card: #152036; --sunken: #1B2842; --ink: #EAF0FA; --muted: #A8B2C8; --subtle: #8B96AE; --line: #283656;
    --heading: #EAF0FA; --primary: #6CF3B1; --primary-hover: #8AF6C3; --on-primary: #0B1A2C;
    --feature: #1F3B62; --on-feature: #FFFFFF;
    --accent: #6CF3B1; --on-accent: #0B1A2C; --accent-soft: #163A33; --accent-wash: #12292B; --accent-ink: #7DF5BB; --bar: #7FB0E0;
    --ok: #57D99A;     --ok-soft: #173A2C;     --ok-ink: #7DF0B4;     --ok-edge: #2F6B4F;     --on-ok: #0B1A2C;
    --warn: #F5B95A;   --warn-soft: #3A2C12;   --warn-ink: #F8CB80;   --warn-edge: #6B5323;
    --danger: #FF8A80; --danger-soft: #3D1D1D; --danger-ink: #FFA59D; --danger-edge: #7A332E; --on-danger: #2B0B09;
    --danger-hover: #FFA59D;
    --off: #A8B2C8;    --off-soft: #232F4A;    --off-ink: #C3CBDC;
    --ring: #6CF3B1; --focus-halo: rgba(108, 243, 177, 0.22); --scrim: rgba(0, 0, 0, 0.62);
    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A8B2C8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    /* Calmer at night: deep tinted cards with a bright edge, not big bright blocks. */
    --status-on-bg: #173A2C;  --status-on-fg: #EAF0FA;  --status-on-edge: #57D99A;
    --status-ask-bg: #3A2C12; --status-ask-fg: #F8CB80; --status-ask-edge: #F5B95A;
    --status-off-bg: #3D1D1D; --status-off-fg: #FFE3E0; --status-off-edge: #FF8A80;
    --switch-track-on: #57D99A;
    --switch-track-off: #5A2A27;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1524; --card: #152036; --sunken: #1B2842; --ink: #EAF0FA; --muted: #A8B2C8; --subtle: #8B96AE; --line: #283656;
  --heading: #EAF0FA; --primary: #6CF3B1; --primary-hover: #8AF6C3; --on-primary: #0B1A2C;
  --feature: #1F3B62; --on-feature: #FFFFFF;
  --accent: #6CF3B1; --on-accent: #0B1A2C; --accent-soft: #163A33; --accent-wash: #12292B; --accent-ink: #7DF5BB; --bar: #7FB0E0;
  --ok: #57D99A;     --ok-soft: #173A2C;     --ok-ink: #7DF0B4;     --ok-edge: #2F6B4F;     --on-ok: #0B1A2C;
  --warn: #F5B95A;   --warn-soft: #3A2C12;   --warn-ink: #F8CB80;   --warn-edge: #6B5323;
  --danger: #FF8A80; --danger-soft: #3D1D1D; --danger-ink: #FFA59D; --danger-edge: #7A332E; --on-danger: #2B0B09;
  --danger-hover: #FFA59D;
  --off: #A8B2C8;    --off-soft: #232F4A;    --off-ink: #C3CBDC;
  --ring: #6CF3B1; --focus-halo: rgba(108, 243, 177, 0.22); --scrim: rgba(0, 0, 0, 0.62);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A8B2C8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  --status-on-bg: #173A2C;  --status-on-fg: #EAF0FA;  --status-on-edge: #57D99A;
  --status-ask-bg: #3A2C12; --status-ask-fg: #F8CB80; --status-ask-edge: #F5B95A;
  --status-off-bg: #3D1D1D; --status-off-fg: #FFE3E0; --status-off-edge: #FF8A80;
  --switch-track-on: #57D99A;
  --switch-track-off: #5A2A27;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
