/* theme.css — this system's own design tokens: its type, colour, space, shape, depth and motion.
   Written in the Design stage and approved by Yarik. Every value here is a decision whose reason is in
   design/direction.md. Loaded after base.css and before system.css by every page and mockup.

   The contract. These names must be defined on :root, because base.css, the build stages and the
   design check (designlib.py check) read them. Each colour is a plain colour — hex, rgb(), hsl() or
   oklch() — or var() to one, so its contrast can be measured:

     --font-body  --font-display  --font-mono  --text-body
     --canvas  --surface  --ink  --ink-2  --ink-3  --line  --line-strong
     --accent  --accent-text  --accent-soft  --focus
     --ok  --ok-soft  --warn  --warn-soft  --bad  --bad-soft  --none  --none-soft
     --ease  --dur-fast  --dur-base

   Everything else — the type scale, spacing, radii, depth, and any tokens for this system's own
   components — is this system's vocabulary. Name it here and list it in design/direction.md.
   Fonts are self-hosted from ui/fonts/ (designlib.py font <name> fetches one and writes its @font-face file). */

/* Direction A «Черта дня» — the seller's ежедневник page: one ruled sheet of petrol-tinted paper, due dates
   as a ruler down the left, a petrol line for today (D-174; plum until 15.11.2026). Geologica alone. Light only. */

@import url("fonts/geologica.css");

:root {
  /* ---- type: Geologica alone; a scale with big jumps ---- */
  --font-body: "Geologica Variable", sans-serif;
  --font-display: "Geologica Variable", sans-serif;
  --font-mono: "Geologica Variable", sans-serif;   /* no monospace in this system: numbers use tabular figures */
  --text-body: 0.9375rem;      /* 15 px */
  --t-xs: 0.78rem;             /* 12.5 — hints, the freshness line, ruler meta */
  --t-sm: 0.845rem;            /* 13.5 — sources, secondary lines, small buttons */
  --t-md: 1.0625rem;           /* 17 — read-only values, figures in «Разбор» */
  --t-lg: 1.3125rem;           /* 21 — group heads, drawer and section titles */
  --t-xl: 1.875rem;            /* 30 — the ruler dates */
  --t-2xl: 2.25rem;            /* 36 — page title */
  --t-3xl: 4rem;               /* 64 — the one lead figure of «Главная»: meeting points, fact against plan (20.11.2026) */
  --w-light: 330;              /* the ruler dates */
  --w-text: 380;
  --w-medium: 520;
  --w-strong: 640;
  --w-title: 680;

  /* ---- paper and ink: petrol in every neutral (D-174) ---- */
  --canvas:      oklch(0.978 0.011 215);   /* the sheet */
  --surface:     oklch(0.996 0.003 215);   /* things laid on the sheet: the drawer, inputs, menus */
  --paper-deep:  oklch(0.952 0.015 215);   /* hover wash, read-only boxes, tracks */
  --ink:         oklch(0.25 0.04 215);
  --ink-2:       oklch(0.42 0.035 215);
  --ink-3:       oklch(0.50 0.03 215);
  --line:        oklch(0.895 0.016 215);
  --line-strong: oklch(0.63 0.035 215);

  /* ---- the one accent: petrol = act here (D-174, was plum) ---- */
  --accent:      oklch(0.44 0.075 215);
  --accent-text:  oklch(0.43 0.075 215);    /* petrol text and links on the sheet */
  --accent-soft: oklch(0.928 0.034 215);
  --accent-ink:   oklch(0.99 0.005 215);   /* text on a petrol fill */
  --focus:       oklch(0.50 0.085 215);

  /* ---- status: meanings fixed by the kit, values tuned to the tinted paper ---- */
  --ok:        oklch(0.49 0.12 150);
  --ok-soft:   oklch(0.95 0.025 155);
  --warn:      oklch(0.52 0.115 62);
  --warn-soft: oklch(0.95 0.045 80);
  --bad:       oklch(0.50 0.17 25);
  --bad-soft:  oklch(0.945 0.028 25);
  --none:      oklch(0.52 0.02 215);
  --none-soft: oklch(0.94 0.01 215);

  /* ---- the three groups of the company's loyalty steps on «Лояльность» (D-616): sky, mint, lilac — no status meaning ---- */
  --wash-g1: oklch(0.925 0.04 240);
  --wash-g2: oklch(0.925 0.04 172);
  --wash-g3: oklch(0.925 0.04 305);

  /* ---- motion: one curve; answers 160 ms, arrivals 200 ms, leaving faster than arriving ---- */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 160ms;
  --dur-base: 200ms;

  /* ---- space: a 4 px base ---- */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px;

  /* ---- shape: radii by the size of the thing; depth only for what floats ---- */
  --r-xs: 3px;     /* notices, kbd, read-only boxes */
  --r-sm: 5px;     /* inputs */
  --r-md: 7px;     /* buttons */
  --r-lg: 10px;    /* menus and popovers */
  --shadow-float: 0 10px 28px -12px color-mix(in oklch, var(--ink), transparent 70%);
  --shadow-drawer: -18px 0 32px -26px color-mix(in oklch, var(--ink), transparent 40%);

  /* ---- frame ---- */
  --pad: clamp(24px, 3vw, 44px);           /* page side margin */
  --ruler: 150px;                          /* the date ruler down the left of every dated list */
  --gap: 28px;                             /* ruler to text */
  --rail: clamp(340px, 30vw, 460px);       /* «Разбор» and the drawer */
  --bar-h: 52px;
  --fresh-h: 28px;
  --head-h: calc(var(--bar-h) + var(--fresh-h) + 1px);
  --measure: 68ch;                         /* longest line of running text */
}

@media (max-width: 1180px) {
  :root { --ruler: 112px; --gap: 18px; --t-xl: 1.5rem; --t-3xl: 3.25rem; }
}
