/* carvel — design tokens. One neutral ramp, one accent, four signals.
   Dark is the default; light follows the system or [data-theme="light"]. */

/* The faces live with the page they serve; no font file is copied into this folder. */
@font-face { font-family: "Aporetic Sans Mono"; src: url("fonts/aporetic-sans-mono-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Aporetic Sans Mono"; src: url("fonts/aporetic-sans-mono-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Aporetic Sans"; src: url("fonts/aporetic-sans-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Aporetic Sans"; src: url("fonts/aporetic-sans-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* type */
  /* The owner's editor face. The interface is set in the mono cut; long reading text in its proportional sibling.
     The family has two weights, so rank comes from size, colour and space; bold marks a title and nothing else. */
  --font-ui: "Aporetic Sans Mono", ui-monospace, Menlo, monospace;
  --font-read: "Aporetic Sans", "Aporetic Sans Mono", system-ui, sans-serif;
  --font-mono: "Aporetic Sans Mono", ui-monospace, Menlo, monospace;
  --text-xs: 11.5px;   /* counts, kbd, stamps */
  --text-sm: 12.5px;   /* meta, labels */
  --text-md: 14px;   /* the interface */
  --text-lg: 15.5px; /* reading text */
  --text-xl: 19px;   /* a pane's title */
  --text-2xl: 25px;  /* a page's title, used once per page */
  --lh-ui: 20px;
  --lh-read: 1.62;
  --w-regular: 400;
  --w-strong: 700;

  /* space: a 4 px grid */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;

  /* shape */
  --r-sm: 5px;   /* chips, kbd */
  --r-md: 7px;   /* controls, rows */
  --r-lg: 10px;  /* cards, menus */
  --r-xl: 14px;  /* dialogs, the composer */
  --control-h: 28px;
  --control-h-lg: 32px;
  --row-h: 32px;

  /* motion */
  --t-fast: 110ms;
  --t-med: 180ms;
  --t-slow: 260ms;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* layout */
  --rail-w: 244px;
  --rail-w-compact: 56px;
  --list-w: 524px;
  --fleet-w: 620px;
  --read-w: 680px;
  --chat-w: 720px;
  --tabbar-h: 56px;

  color-scheme: dark;
  --bg: #0a0b0d;            /* the canvas */
  --bg-rail: #0d0e11;       /* the rail */
  --surface-1: #121418;     /* raised: cards, the composer, menus */
  --surface-2: #181b20;     /* hover */
  --surface-3: #1f2329;     /* selected, pressed, inputs */
  --line: rgba(255, 255, 255, .065);
  --line-strong: rgba(255, 255, 255, .12);
  --text: #edeef0;
  --text-2: #a3a8b0;
  --text-3: #6c727b;
  --text-on-solid: #0a0b0d;
  --solid: #edeef0;         /* the one primary button */
  --solid-hover: #ffffff;
  --on-solid-fill: rgba(127, 127, 127, .22);  /* a key that sits on the solid button */
  --scrim: rgba(4, 5, 8, .5);
  --accent: #8b93ff;        /* selection, focus, links, work in motion */
  --accent-soft: rgba(139, 147, 255, .13);
  --accent-line: rgba(139, 147, 255, .45);
  --attn: #f2a93b;          /* yours to act on */
  --attn-soft: rgba(242, 169, 59, .13);
  --ok: #46d28f;
  --ok-soft: rgba(70, 210, 143, .13);
  --bad: #ff6b72;
  --bad-soft: rgba(255, 107, 114, .13);
  --info: #62b3f2;
  --info-soft: rgba(98, 179, 242, .13);
  --shadow-pop: 0 0 0 1px var(--line-strong), 0 12px 32px -8px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3);
  --shadow-float: 0 0 0 1px var(--line), 0 8px 24px -10px rgba(0, 0, 0, .55);

  /* The inks a file is read in, for code blocks and the work pane alike. Each
     one points at a token of the theme above, so the light theme's own darker
     accent, ok and info carry them there with no second writing: a keyword is
     the accent, a literal the ok green, a type the info blue, a comment the
     quiet ink, and brackets and operators stay one step under the text. Amber
     and red never appear in code — they are the page's to-act-on and bad inks. */
  --code-keyword: var(--accent);
  --code-string: var(--ok);
  --code-type: var(--info);
  --code-comment: var(--text-3);
  --code-punct: var(--text-2);
}

/* The page sets data-theme from the setting (system, light, dark); system reads prefers-color-scheme.
   Light is read on paper-white, so each ink is darker than the dark theme's: the
   measured table is in DESIGN.md, and every value on the third dot is the worst
   surface it is drawn on (--surface-3), at no less than 4.5:1. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-rail: #f8f8f9;
  --surface-1: #ffffff;
  --surface-2: #f3f3f5;
  --surface-3: #ececf0;
  --line: rgba(10, 12, 20, .16);
  --line-strong: rgba(10, 12, 20, .45);
  --text: #111317;
  --text-2: #464c56;   /* 7.2 on the selected surface */
  --text-3: #646a73;   /* 4.5 on the selected surface; the older #7c828c read 3.2, #8a909a 2.7 */
  --text-on-solid: #ffffff;
  --solid: #111317;
  --solid-hover: #000000;
  --on-solid-fill: rgba(127, 127, 127, .22);
  --scrim: rgba(4, 5, 8, .5);
  --accent: #4b55d6;
  --accent-soft: rgba(75, 85, 214, .09);
  --accent-line: rgba(75, 85, 214, .4);
  --attn: #8a5200;
  --attn-soft: rgba(214, 137, 16, .13);
  --ok: #15724a;
  --ok-soft: rgba(24, 121, 78, .1);
  --bad: #c0262c;
  --bad-soft: rgba(205, 43, 49, .09);
  --info: #0a5fae;
  --info-soft: rgba(11, 111, 199, .09);
  --shadow-pop: 0 0 0 1px var(--line-strong), 0 14px 36px -10px rgba(15, 20, 40, .22), 0 2px 6px rgba(15, 20, 40, .06);
  --shadow-float: 0 0 0 1px var(--line), 0 10px 28px -12px rgba(15, 20, 40, .18);
}

/* Same values, for a page that sets no data-theme at all: the system decides.
   CSS cannot share one declaration list between a selector and a media query,
   so the light block is written twice; change both. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #ffffff;
    --bg-rail: #f8f8f9;
    --surface-1: #ffffff;
    --surface-2: #f3f3f5;
    --surface-3: #ececf0;
    --line: rgba(10, 12, 20, .16);
    --line-strong: rgba(10, 12, 20, .45);
    --text: #111317;
    --text-2: #464c56;
    --text-3: #646a73;
    --text-on-solid: #ffffff;
    --solid: #111317;
    --solid-hover: #000000;
    --on-solid-fill: rgba(127, 127, 127, .22);
    --scrim: rgba(4, 5, 8, .5);
    --accent: #4b55d6;
    --accent-soft: rgba(75, 85, 214, .09);
    --accent-line: rgba(75, 85, 214, .4);
    --attn: #8a5200;
    --attn-soft: rgba(214, 137, 16, .13);
    --ok: #15724a;
    --ok-soft: rgba(24, 121, 78, .1);
    --bad: #c0262c;
    --bad-soft: rgba(205, 43, 49, .09);
    --info: #0a5fae;
    --info-soft: rgba(11, 111, 199, .09);
    --shadow-pop: 0 0 0 1px var(--line-strong), 0 14px 36px -10px rgba(15, 20, 40, .22), 0 2px 6px rgba(15, 20, 40, .06);
    --shadow-float: 0 0 0 1px var(--line), 0 10px 28px -12px rgba(15, 20, 40, .18);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --t-fast: 0ms; --t-med: 0ms; --t-slow: 0ms; }
}
