/* The Jarvis theme: every colour, font, size, spacing step, corner and shadow.

   This one file styles the app window, the website, the bubble by the cursor, the
   phone layout, the sign-in pages and the desktop app's start-up screen. Nothing else
   contains a colour or a pixel size, so to restyle Jarvis, change values here.

   - Jarvis has one look: dark navy glass with an electric-blue accent.
   - After editing: run `npm run build` in ui/ (and rebuild the desktop app if you want
     its start-up screen to match). While trying things out you can also edit
     ui/dist/theme.css and just reload.
   - Two things CSS cannot take from a variable: the widths at which the layout changes
     (phone below 720px; the Home page's right column moves down below 1100px). They are
     written once each, at the bottom of ui/src/styles.css.
*/

/* Inter, bundled with Jarvis (ui/public/fonts): nothing is fetched from the internet. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-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;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-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;
}

:root {
  color-scheme: dark;

  /* ---- colours ---- */
  --color-bg: #070B14;            /* page background: near-black navy */
  --color-panel-solid: #0D1320;   /* popups and menus, which must hide what is behind them */
  --color-panel: color-mix(in srgb, var(--color-panel-solid) 85%, transparent);   /* glass cards */
  --color-raised: rgba(255, 255, 255, 0.04);    /* rows, fields and tiles inside a card */
  --color-hover: rgba(255, 255, 255, 0.07);
  --color-border: rgba(255, 255, 255, 0.06);
  --color-border-strong: rgba(255, 255, 255, 0.14);
  --color-text: #FFFFFF;
  --color-muted: #8A94A6;         /* secondary text */
  --color-accent-from: #1E6BFF;   /* electric blue: the gradient runs from this ... */
  --color-accent-to: #2F9BFF;     /* ... to this */
  --color-accent: #2F9BFF;        /* links, icons, highlights, focus */
  --color-on-accent: #FFFFFF;     /* text on the accent colour */
  --color-ok: #22C55E;
  --color-warn: #F59E0B;
  --color-on-warn: #1A1205;
  --color-danger: #EF4444;
  --color-on-danger: #FFFFFF;
  --color-violet: #8B5CF6;        /* the memory bar */
  --color-user: color-mix(in srgb, var(--color-accent-from) 22%, var(--color-panel-solid));   /* your own messages */
  --color-scrim: rgba(3, 6, 12, 0.72);          /* behind a popup */
  --color-track: rgba(255, 255, 255, 0.08);     /* the empty part of a meter */
  --gradient-accent: linear-gradient(135deg, var(--color-accent-from), var(--color-accent-to));
  /* how strongly badges and highlighted rows are tinted */
  --tint-ok: color-mix(in srgb, var(--color-ok) 18%, transparent);
  --tint-warn: color-mix(in srgb, var(--color-warn) 20%, transparent);
  --tint-danger: color-mix(in srgb, var(--color-danger) 20%, transparent);
  --tint-accent: color-mix(in srgb, var(--color-accent) 16%, transparent);
  --tint-violet: color-mix(in srgb, var(--color-violet) 20%, transparent);

  /* ---- backgrounds ---- */
  /* the whole app: a faint blue wash from the top-left corner */
  --bg-app: radial-gradient(ellipse 60% 50% at 0% 0%, rgba(30, 107, 255, 0.10), transparent 70%), var(--color-bg);
  /* Home only: the glow in the top-right */
  --bg-home-glow: radial-gradient(ellipse 55% 60% at 78% 8%, rgba(30, 107, 255, 0.28), transparent 70%);
  --bg-sidebar: linear-gradient(180deg, rgba(13, 19, 32, 0.72), rgba(9, 14, 25, 0.72) 60%, rgba(18, 52, 120, 0.30));
  --arc-color: rgba(64, 160, 255, 0.85);        /* the thin curve drawn across the Home glow */
  --arc-width: 2px;
  --arc-fill: radial-gradient(circle at 32% 6%, rgba(30, 107, 255, 0.30), transparent 42%);   /* the soft light inside the curve */
  --arc-left: 36%;                /* how far across Home the curve starts */
  --arc-glow: 0 0 36px rgba(47, 155, 255, 0.6);

  /* ---- type ---- */
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-md: 15px;                /* body text */
  --text-lg: 18px;                /* section titles */
  --text-xl: 22px;                /* page titles */
  --text-sub: clamp(16px, 1.7vw, 22px);     /* the line under the greeting */
  --text-hero: clamp(30px, 4vw, 48px);      /* the greeting: 48px on a normal window */
  --text-input-phone: 16px;       /* below 16px, iPhones zoom the page when you tap a field */
  --line-tight: 1.4;
  --line-body: 1.55;
  --line-hero: 1.1;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-bold: 600;             /* semibold: section titles, buttons */
  --weight-heavy: 700;            /* bold: the greeting */
  --tracking-caps: 0.05em;
  --tracking-hero: -0.02em;

  /* ---- spacing ---- */
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 10px;
  --space-6: 12px;
  --space-7: 14px;
  --space-8: 16px;
  --space-9: 20px;
  --space-10: 24px;
  --space-11: 32px;
  --space-12: 40px;
  /* Home packs a little tighter in a short window, so more of it fits without scrolling */
  --gap-home: clamp(12px, 2.1vh, 20px);
  --pad-panel: clamp(11px, 1.8vh, 16px);
  --pad-row: clamp(3px, 0.75vh, 8px);       /* above and below each meter and module line */

  /* ---- lines and corners ---- */
  --border-width: 1px;
  --border-strong: 3px;           /* the coloured edge of a warning */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;              /* cards */
  --radius-pill: 999px;
  --focus-width: 2px;

  /* ---- shadows and glows ---- */
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 16px 36px rgba(0, 0, 0, 0.5);          /* a card under the mouse */
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.6);
  --shadow-bar: 0 -8px 24px rgba(0, 0, 0, 0.45);
  --shadow-accent: 0 6px 20px rgba(30, 107, 255, 0.45);   /* under blue buttons and the active page */
  --glow-accent: 0 0 0 1px rgba(47, 155, 255, 0.55), 0 0 32px rgba(30, 107, 255, 0.28);          /* the ask box */
  --glow-focus: 0 0 0 1px rgba(47, 155, 255, 0.9), 0 0 40px rgba(30, 107, 255, 0.45);            /* ... while typing */
  --shadow-bubble: 0 0 0 1px rgba(47, 155, 255, 0.5), 0 0 10px rgba(47, 155, 255, 0.45);         /* the bubble's edge */
  --glow-logo: drop-shadow(0 8px 28px rgba(30, 107, 255, 0.55));
  --blur-glass: 18px;             /* how much a glass card blurs what is behind it */

  /* ---- sizes ---- */
  --width-sidebar: 240px;
  --width-sidebar-mini: 76px;     /* collapsed to icons */
  --width-rail: 320px;            /* Home's right column */
  --width-content: 920px;         /* chat and the card pages */
  --width-wide: 1180px;           /* the history table */
  --width-home: 1500px;
  --width-modal: 560px;
  --width-palette: 620px;
  --width-menu: 300px;
  --width-form: 420px;            /* the sign-in pages */
  --width-field: 240px;
  --width-field-sm: 90px;
  --width-search: 340px;
  --width-bubble-max: 82%;        /* how wide a chat message may get */
  --height-topbar: 72px;
  --height-tabbar: 62px;          /* the phone's bottom bar */
  --height-scroll: 260px;         /* tallest a code box grows before it scrolls */
  --height-edit: 140px;           /* the message editor in an approval popup */
  --height-diff: 480px;           /* tallest a code diff grows before it scrolls */
  --height-palette: 420px;
  --height-ask: 56px;             /* the typing area of the ask box */
  --height-ask-box: clamp(190px, 30vh, 340px);        /* the tallest the Home ask box grows */
  --height-spark: clamp(20px, 3.4vh, 34px);   /* the network sparkline */
  --height-meter: 4px;
  --size-touch: 44px;             /* smallest comfortable tap target on a phone */
  --size-button: 40px;            /* round icon buttons */
  --size-send: 46px;
  --size-check: 18px;
  --size-dot: 8px;
  --size-logo: 34px;              /* the J beside the name */
  --size-logo-hero: clamp(72px, 9vw, 132px);   /* the big J on Home */
  --size-avatar: 44px;
  --size-tile: clamp(42px, 5.6vh, 52px);   /* a Quick Access app tile */
  --width-tile: 76px;             /* ... and the room it gets, name included */
  --size-arc: 1100px;             /* the circle whose edge is the curve on Home */
  --icon-sm: 16px;
  --icon-md: 20px;
  --icon-lg: 26px;
  --icon-stroke: 1.6;             /* thin-line icons */

  /* ---- motion ---- */
  --ease: 180ms ease;             /* hovers and presses */
  --lift: -3px;                   /* how far a card rises under the mouse */
  --fade: 0.4s;
  --pulse: 1s;
  --spin: 0.9s;
}
