@import url("fonts/pt-serif.css");
@import url("fonts/pt-sans.css");

/* 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-ink  --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 «Бланк» (D-170 (b)): one white sheet of paper on a blue-grey desk; fields as ruled boxes with
   the label inside; sections between double rules; ParaType's PT Serif and PT Sans, drawn for Russian official
   documents; one ink-blue accent for «act here»; the гриф and the виза. */

:root {
  /* ---------- type: PT Serif for titles, the гриф and the visa; PT Sans for everything read and typed ---------- */
  --font-body: "PT Sans", sans-serif;
  --font-display: "PT Serif", serif;
  --font-mono: ui-monospace, Menlo, Consolas, monospace;   /* sha256 only: a value, never a label */
  --text-body: 0.9375rem;        /* 15px: the text, the controls, the rows */

  /* a real scale: small steps for the working text, big jumps to the titles */
  --text-xs: 0.75rem;            /* 12px: the label inside a field's box, table heads */
  --text-sm: 0.84375rem;         /* 13.5px: quiet lines, notes, hints, counts beside a button */
  --text-md: 0.9375rem;          /* 15px: = --text-body; kept under the classic name the pages' inline styles use */
  --text-row: 0.90625rem;        /* 14.5px: table rows */
  --text-lg: 1.0625rem;          /* 17px: h3, PT Serif — a request's «Заявка №n» in a list */
  --text-xl: 1.4375rem;          /* 23px: h2, PT Serif — «Для всех строк», a page's sections */
  --text-figure: 1.375rem;       /* 22px: the one key figure of a facts line («строк найдено») */
  --text-name: 1.25rem;          /* 20px: a name in the гриф */
  --text-visa: 1.5rem;           /* 24px: the role or name in a visa */
  --text-2xl: 2.5rem;            /* 40px: h1, PT Serif — the document's title */
  --leading-tight: 1.15;
  --leading-normal: 1.4;
  --weight-regular: 400;
  --weight-bold: 700;            /* the only two weights the two families ship here */

  /* ---------- colour: a cool blue-grey desk, one white sheet, navy-black ink ---------- */
  --canvas: oklch(0.895 0.016 248);       /* the desk */
  --surface: oklch(0.996 0.002 248);      /* the sheet */
  --ink: oklch(0.235 0.038 262);          /* text, the heavy rule round «Для всех строк» */
  --ink-2: oklch(0.40 0.032 258);         /* labels, quiet text */
  --ink-3: oklch(0.47 0.026 255);         /* the quietest text: phones, placeholders, signature lines */
  --line: oklch(0.885 0.012 250);         /* hairlines between rows; decoration, never a control's edge */
  --line-strong: oklch(0.615 0.024 255);  /* the rules of the бланк: field boxes, heads, double rules (3.67:1) */
  --band: oklch(0.962 0.011 250);         /* a ruled heading band: a group's line, a request's head */
  --hover: oklch(0.972 0.014 262);        /* under the pointer: a row, a cell, a summary */

  /* one accent, ink blue beside T-1's blue header row without copying it: «act here» only */
  --accent: oklch(0.415 0.145 263);
  --accent-ink: oklch(0.99 0.004 263);
  --accent-soft: oklch(0.948 0.026 263);
  --accent-press: oklch(0.33 0.12 263);   /* the primary button held down */
  --focus: oklch(0.50 0.19 263);

  /* status: the kit's meaning, this paper's values (each 4.5:1 on its soft, on the sheet and on the desk) */
  --ok: oklch(0.45 0.11 152);
  --ok-soft: oklch(0.955 0.035 152);
  --warn: oklch(0.47 0.10 62);
  --warn-soft: oklch(0.952 0.052 84);
  --bad: oklch(0.47 0.17 26);
  --bad-soft: oklch(0.958 0.024 24);
  --none: oklch(0.47 0.016 255);
  --none-soft: oklch(0.955 0.006 255);

  /* ---------- space: 4px steps (the classic names: the pages' inline styles use --space-2…8) ---------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* ---------- shape: a sheet has corners ---------- */
  --radius-sheet: 2px;           /* the sheet and the login card: the paper's cut corner, barely softened */
  --radius-control: 1px;         /* buttons, fields, chips: a boxed cell is square */
  --radius-mark: 1px;            /* the small «!» square of a mark */

  /* ---------- rules: the бланк is drawn with lines, not boxes of colour ---------- */
  --rule-hair: 1px solid var(--line);              /* between rows */
  --rule: 1px solid var(--line-strong);            /* a field's box, a table head, a ruled block */
  --rule-ink: 1px solid var(--ink-3);              /* a signature line; a group's top edge */
  --rule-heavy: 2px solid var(--ink);              /* the main form block («Для всех строк») */
  --rule-double: 3px double var(--line-strong);    /* between the sections of a document */
  --rule-double-ink: 3px double var(--ink-2);      /* the foot of the sheet: the actionbar */

  /* ---------- depth: only the sheet lifts off the desk ---------- */
  --sheet-edge: oklch(0.80 0.018 250);
  --sheet-shadow: 0 1px 1px oklch(0.235 0.038 262 / 0.07), 0 8px 22px -14px oklch(0.235 0.038 262 / 0.30);

  /* ---------- the page and its components ---------- */
  --page-max: 1360px;            /* the sheet's widest */
  --page-gutter: 16px;           /* the desk showing at each side, at least */
  --page-pad: 44px;              /* the sheet's margin, as on paper */
  --page-pad-narrow: 28px;       /* the sheet's margin under 1180px */
  --bar-h: 52px;                 /* the top bar's height, one row */
  --cell-pad-x: 11px;            /* a field's box: its inside margin */
  --cell-pad-top: 7px;           /* the label set small inside the top of the box */
  --cell-control-h: 30px;        /* the control under the label */
  --row-py: 6px;                 /* a table row's padding */
  --row-px: 10px;
  --grif-min: 300px;             /* the гриф block at the head's right */
  --visa-min: 320px;
  --group-key: 280px;            /* a group's line: the «Гиперссылка» cell */
  --group-city: 160px;
  --group-manager: 280px;
  --unique-w: 210px;             /* the monitor number's column, under the «Гиперссылка» cell */
  --control-h: 34px;             /* a button, a bare select */
  --z-sticky: 10;
  --z-bar: 20;

  /* ---------- motion: still paper — answers in 120 ms, colour and opacity only; one landing ---------- */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 120ms;             /* hover, press, focus, a fold */
  --dur-base: 180ms;             /* a notice arriving */
  --dur-visa: 180ms;             /* the visa lands, once, on the confirmation */
  --visa-from: 1.03;             /* …from this scale to 1 */

  /* ---------- paper: a page printed is black ink on white, as base.css prints it ---------- */
  --print-paper: #fff;
  --print-ink: #000;
}
