bereg-ds 0.0.0-stage → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,29 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The project follows [Semantic Versioning](https://semver.org/):
4
+ a breaking change to a token name, a class name or a component prop is a major version.
5
+
6
+ ## 1.1.0 (unreleased)
7
+
8
+ - Optional light theme: `bereg-ds/theme-light.css` (not part of `bereg-ds.css`). Follows `prefers-color-scheme`
9
+ unless `<html data-theme="light|dark">` is set. Text contrast 7:1 or more, interactive borders 3:1 or more.
10
+ - Light tokens in `tokens/themes/light/*.json` (DTCG) and `bereg-ds/tokens-light.json`.
11
+ - Dark theme: `--muted` (`--prim-slate-400`) #8ea3bf → #91a6c2, so muted text on `--surface` is 7.2:1 (was 6.9:1).
12
+ - Storybook: docs pages (MDX) follow the theme switch too (before, they followed the system setting); docs links use `--accent`;
13
+ code colors in docs raised to 7:1; contrast table shows border colors as lines, not as text.
14
+ - Tests: contrast for both themes, including hover, selection, header and focus colors.
15
+ - Storybook: theme switch in the toolbar (Dark, Light, System), Foundations / Themes page, contrast computed from tokens.
16
+
17
+ ## 1.0.0 (2026-11-17)
18
+
19
+ First release.
20
+
21
+ - Design tokens in W3C DTCG format (`tokens/*.json`), built with Style Dictionary into CSS variables (rem) and JS/JSON (px).
22
+ - Strict scale of 4 for spacing, gaps and radii; type scale close to 1.25 (12 to 80px).
23
+ - Dark theme: semantic colors by role, text contrast 7:1 or more, `--line-strong` (3:1+) for interactive borders.
24
+ - Fonts: IBM Plex Sans (variable) and Mono through Fontsource, metric-matched fallbacks.
25
+ - CSS: base styles and text-style classes, components (Button, Link, Nav Link, Tag, Card, Quote, Book Promo,
26
+ Filter Tab, Section Head, Facts, Timeline, Post list, Site Header, Site Footer, Prose), blueprint grid background,
27
+ optional HDR accents.
28
+ - React components (TypeScript) over the same classes.
29
+ - Storybook with docs pages, all components and an accessibility check (axe-core) on every story.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Konstantin Beregovoy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,134 @@
1
- # Temporary Holding Version
1
+ # Bereg DS
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The **Engineering Blueprint** design system by [Konstantin Beregovoy](https://bereg.dev): dark, technical, drawn like a blueprint.
4
+ Design tokens, CSS components and React components from one source.
5
+
6
+ - **Docs and live components:** [ds.bereg.dev](https://ds.bereg.dev) (Storybook)
7
+ - **Figma:** [Bereg DS](https://www.figma.com/design/nWkFlhkomx90UBXw6nFAQj)
8
+ - **npm:** [bereg-ds](https://www.npmjs.com/package/bereg-ds)
9
+ - **Live example:** [bereg.dev](https://bereg.dev)
10
+ - **Case study:** [bereg.dev/projects/bereg-ds](https://bereg.dev/projects/bereg-ds/)
11
+
12
+ ## Install
13
+
14
+ ```sh
15
+ npm i bereg-ds
16
+ ```
17
+
18
+ IBM Plex Sans and Mono come with it (self-hosted through Fontsource, no Google Fonts).
19
+
20
+ ## Use with CSS (any project: Astro, plain HTML, Vue...)
21
+
22
+ ```js
23
+ import 'bereg-ds/bereg-ds.css'; // fonts + tokens + base + components
24
+ ```
25
+
26
+ ```html
27
+ <a class="btn btn-primary" href="/projects/">Projects</a>
28
+ <article class="card">
29
+ <span class="meta">Open source · 2026</span>
30
+ <div class="card-body">
31
+ <h3 class="card-title"><a class="stretch" href="/projects/hdr-glow/">hdr-glow</a></h3>
32
+ <p class="card-text">Makes selected colors glow on HDR screens.</p>
33
+ </div>
34
+ <ul class="tags" aria-label="Stack"><li>TypeScript</li><li>React</li></ul>
35
+ </article>
36
+ ```
37
+
38
+ Import only what you need:
39
+
40
+ | File | What |
41
+ |---|---|
42
+ | `bereg-ds/fonts.css` | IBM Plex Sans (variable) and Mono 400, metric-matched fallbacks |
43
+ | `bereg-ds/tokens.css` | CSS variables: colors, spacing, radii, type scale, motion |
44
+ | `bereg-ds/base.css` | Page defaults, headings, text-style classes (`.text-h1`, `.text-meta`...), `.blueprint` grid |
45
+ | `bereg-ds/components.css` | Components: `.btn`, `.card`, `.quote`, `.tag`, `.filter-tab`, `.section-head`, `.subhead`, `.facts`, `.timeline`, `.posts`, `.book-promo`, `.site-header`, `.site-footer`, `.prose`, `.wrap` |
46
+ | `bereg-ds/hdr.css` | Optional HDR accents (`.hdr-logo`, `.hdr-card`) |
47
+ | `bereg-ds/theme-light.css` | Optional light theme (see below) |
48
+
49
+ ## Light theme (optional)
50
+
51
+ Dark is the default. Projects that need a light theme add one file; projects that stay dark do not load it.
52
+
53
+ ```js
54
+ import 'bereg-ds/bereg-ds.css';
55
+ import 'bereg-ds/theme-light.css';
56
+ ```
57
+
58
+ It follows the system setting (`prefers-color-scheme`). `<html data-theme="light">` or `data-theme="dark"` overrides it.
59
+ The switch, `localStorage` and a small inline script against the flash on load are up to the project:
60
+ see [Foundations / Themes](https://ds.bereg.dev/?path=/docs/foundations-themes--docs).
61
+
62
+ ## Use with React
63
+
64
+ ```tsx
65
+ import 'bereg-ds/bereg-ds.css';
66
+ import { Button, Card, Section, Sections } from 'bereg-ds/react';
67
+
68
+ <Sections>
69
+ <Section id="projects" title="Selected projects" link={{ href: '/projects/', label: 'All projects' }}>
70
+ <Card meta="Open source · 2026" title="hdr-glow" href="/projects/hdr-glow/" tags={['TypeScript', 'React']}>
71
+ Makes selected colors glow on HDR screens.
72
+ </Card>
73
+ </Section>
74
+ </Sections>
75
+ <Button href="/contact/">Contact</Button>
76
+ ```
77
+
78
+ React components only render markup and classes; all styles live in the CSS, so CSS and React look the same.
79
+ React is an optional peer dependency (18 or newer).
80
+
81
+ Components: `Button`, `Link`, `NavLink`, `Tag`, `Tags`, `Card`, `Quote`, `BookPromo`, `FilterTabs`, `Sections`, `Section`,
82
+ `Facts`, `Timeline`, `PostList`, `Subhead`, `SiteHeader`, `SiteFooter`, `Wrap`.
83
+
84
+ ## Tokens in JavaScript
85
+
86
+ ```js
87
+ import { colorAccent, space4 } from 'bereg-ds/tokens'; // px values
88
+ import tokens from 'bereg-ds/tokens.json';
89
+ import light from 'bereg-ds/tokens-light.json'; // light theme colors
90
+ ```
91
+
92
+ The source tokens (W3C DTCG format) are in `tokens/*.json`, the light theme in `tokens/themes/light/*.json`.
93
+
94
+ ## Rules of the system
95
+
96
+ 1. **Strict scale of 4.** Spacing, gaps and radii are multiples of 4. The name is the multiplier: `--space-3` = 12px.
97
+ Strokes (1/2/3px), corner ticks (11/22px) and breakpoints (640/760px) are separate sizes.
98
+ 2. **Tokens only.** No raw colors or pixel spacing in components (a test checks it).
99
+ 3. **Units.** Font sizes and spacing in rem, line height without units, letter spacing in em, strokes in px,
100
+ breakpoints in em in media queries (`40em`, `47.5em`). The `--bp-sm`/`--bp-md` tokens (640/760px) are for reference:
101
+ CSS variables do not work in media queries.
102
+ 4. **Accessibility.** Text contrast 7:1 or more. Interactive borders use `--line-strong` (3:1 or more),
103
+ `--line` is decorative only. Visible focus on every interactive element. Links are underlined.
104
+ Respects `prefers-reduced-motion` and `forced-colors`.
105
+ 5. **Dark by default.** The light theme is an optional file with the same token names.
106
+ 6. **HDR is an optional accent**, not a default.
107
+ 7. **Exceptions belong to the project.** A special case lives in that project's CSS, not in the system.
108
+
109
+ ## Develop
110
+
111
+ Node version is pinned in `.nvmrc` (`nvm use`).
112
+
113
+ ```sh
114
+ npm install
115
+ npm run build # tokens -> dist/css/tokens.css + dist/tokens, CSS, React
116
+ npm test # component and rule tests
117
+ npm run storybook # docs and live components on http://localhost:6006
118
+ ```
119
+
120
+ Change tokens in Figma first, then in `tokens/*.json`, then run `npm run build`.
121
+
122
+ ## Release
123
+
124
+ ```sh
125
+ npm login
126
+ npm publish # prepublishOnly runs build and tests
127
+ ```
128
+
129
+ Update `CHANGELOG.md` and the version in `package.json` first.
130
+ Storybook (ds.bereg.dev) deploys automatically on push to `main`.
131
+
132
+ ## License
133
+
134
+ MIT. IBM Plex is licensed under the SIL Open Font License (comes with the Fontsource packages).
package/SKILL.md ADDED
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: bereg-ds
3
+ description: Konstantin Beregovoy's design system (Engineering Blueprint, dark, IBM Plex). Use when building or changing UI in one of Konstantin's projects. First ask which design system the project uses; apply Bereg DS only if the answer is Bereg DS.
4
+ ---
5
+
6
+ # Bereg DS
7
+
8
+ ## Step 1: always ask first
9
+
10
+ Before writing or changing any UI, ask:
11
+
12
+ > Which design system does this project use: Bereg DS (my own) or another one?
13
+
14
+ - **Bereg DS** → follow this skill.
15
+ - **Another system** (a work project, a client's design system, Tailwind theme, MUI...) → do **not** apply Bereg DS.
16
+ Do not import its CSS, do not use its tokens, colors, fonts or class names. Work only with the project's own system.
17
+ - **Not sure / no answer** → do not apply Bereg DS; ask again before styling anything.
18
+
19
+ Do not mix systems in one project.
20
+
21
+ ## Step 2: install and import
22
+
23
+ ```sh
24
+ npm i bereg-ds
25
+ ```
26
+
27
+ ```js
28
+ import 'bereg-ds/bereg-ds.css'; // fonts + tokens + base + components
29
+ import { Button, Card } from 'bereg-ds/react'; // only in React projects
30
+ // import 'bereg-ds/hdr.css'; // only if an HDR accent is asked for
31
+ // import 'bereg-ds/theme-light.css'; // only if the project needs a light theme
32
+ ```
33
+
34
+ Without React, use the same CSS classes in HTML (see README.md).
35
+
36
+ ## Rules
37
+
38
+ 1. **Use components first.** Button, Link, NavLink, Tag/Tags, Card, Quote, BookPromo, FilterTabs, Sections/Section,
39
+ Facts, Timeline, PostList, Subhead, SiteHeader, SiteFooter, Wrap. Do not restyle them per page.
40
+ 2. **Tokens only.** Colors: `var(--bg)`, `--surface`, `--text`, `--muted`, `--line`, `--line-strong`, `--accent`,
41
+ `--accent-ink`, `--highlight`, `--focus`. Never hard-code hex colors or primitives (`--prim-*`).
42
+ 3. **Scale of 4.** Spacing, gaps and radii only from `--space-1` (4px) … `--space-16` (64px) and `--radius-sm|md|lg`.
43
+ No 6px, 10px, 14px. Strokes `--border-thin|medium|thick` in px.
44
+ 4. **Type.** Use the text-style classes (`.text-h1`, `.text-h2`, `.text-h3`, `.text-lede`, `.text-body`, `.text-small`,
45
+ `.text-meta`, `.text-label`, `.text-caps`, `.text-tag`, `.text-code`, `.text-footnote`, `.text-caption`, `.text-strong`) or `--font-size-*` tokens. Fonts: `var(--font)`,
46
+ `var(--mono)`. Sizes in rem, line height unitless.
47
+ 5. **Accessibility.** Borders that identify an interactive element use `--line-strong`; `--line` is decorative.
48
+ Keep the focus ring (`:focus-visible`, 3px `--focus`, offset 3px). Underline links. Every section has a heading
49
+ (`Section` does it). Respect `prefers-reduced-motion` and `forced-colors`.
50
+ 6. **Dark by default.** Add `theme-light.css` only if the project asks for a light theme. Never invent colors for
51
+ either theme; use the semantic tokens so both themes work. The theme switch and its storage live in the project.
52
+ 7. **HDR only when asked**, for one accent at a time, always with an SDR fallback (`hdr.css`).
53
+ 8. **Exceptions stay in the project.** If a design needs a value the system does not have, put it in the project's
54
+ own CSS with a comment, and tell Konstantin. Do not edit the package for one project.
55
+
56
+ ## Links
57
+
58
+ - Docs and live components: https://ds.bereg.dev
59
+ - Figma: https://www.figma.com/design/nWkFlhkomx90UBXw6nFAQj
60
+ - npm: https://www.npmjs.com/package/bereg-ds
61
+ - Source: https://github.com/KonstantinBeregovoy/bereg-ds
@@ -0,0 +1,93 @@
1
+ /* Bereg DS base: page defaults, typography and text-style classes. Needs tokens.css.
2
+ Text-style classes mirror the Figma text styles (Display/H1 -> .text-h1, Mono/Caps -> .text-caps, ...). */
3
+
4
+ *, *::before, *::after { box-sizing: border-box; }
5
+
6
+ html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
7
+ @media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
8
+
9
+ body {
10
+ margin: 0;
11
+ background: var(--bg);
12
+ color: var(--text);
13
+ font-family: var(--font);
14
+ font-size: var(--font-size-base);
15
+ line-height: var(--leading-body);
16
+ -webkit-font-smoothing: antialiased;
17
+ }
18
+
19
+ img, svg, video { max-width: 100%; height: auto; }
20
+ img { display: block; }
21
+
22
+ a { color: var(--accent); text-underline-offset: 3px; }
23
+ a:hover { color: var(--highlight); text-decoration-thickness: 2px; }
24
+
25
+ :focus-visible { outline: var(--border-thick) solid var(--focus); outline-offset: var(--focus-offset); border-radius: var(--radius-sm); }
26
+ ::selection { background: var(--selection); color: var(--selection-text); }
27
+
28
+ /* Skip link: first element in <body>, visible on keyboard focus. */
29
+ .skip {
30
+ position: absolute; left: var(--space-4); top: -100px; z-index: 10;
31
+ background: var(--accent); color: var(--accent-ink);
32
+ padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
33
+ }
34
+ .skip:focus { top: var(--space-4); }
35
+
36
+ /* Page container: content width = --wrap minus side padding. */
37
+ .wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--space-6); }
38
+
39
+ /* Headings */
40
+ h1, h2, h3 { font-family: var(--font); margin: 0; }
41
+ h1, .text-h1 { font-size: clamp(2.625rem, 1.5rem + 5vw, var(--font-size-display)); font-weight: var(--weight-bold); line-height: var(--leading-tight); letter-spacing: var(--tracking-display); }
42
+ h2, .text-h2 { font-size: clamp(1.75rem, 1.25rem + 2.4vw, var(--font-size-3xl)); font-weight: var(--weight-semibold); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); }
43
+ h3, .text-h3 { font-size: var(--font-size-lg); font-weight: var(--weight-semibold); line-height: var(--leading-tight); letter-spacing: var(--tracking-snug); }
44
+ p { margin: 0 0 var(--space-4); }
45
+
46
+ /* Text styles (classes). Sizes in rem follow the user's browser font size. */
47
+ .text-h1-subtitle { font-size: var(--font-size-2xl); font-weight: var(--weight-light); line-height: var(--leading-tight); letter-spacing: var(--tracking-snug); }
48
+ .text-facts { font-size: var(--font-size-4xl); font-weight: var(--weight-semibold); line-height: var(--leading-tight); letter-spacing: var(--tracking-tighter); }
49
+ .text-h2-article { font-size: var(--font-size-2xl); font-weight: var(--weight-semibold); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); }
50
+ .text-post-title { font-size: var(--font-size-xl); font-weight: var(--weight-semibold); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); }
51
+ .text-brand { font-size: var(--font-size-base); font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); }
52
+ .text-lede, .lede { font-size: clamp(1.125rem, 1rem + 0.6vw, var(--font-size-lg)); font-weight: var(--weight-light); line-height: var(--leading-snug); color: var(--muted); max-width: 62ch; }
53
+ .text-lede-hero { font-size: var(--font-size-lg); font-weight: var(--weight-regular); line-height: var(--leading-snug); color: var(--text); max-width: 62ch; }
54
+ .text-body { font-size: var(--font-size-base); line-height: var(--leading-body); }
55
+ .text-small { font-size: var(--font-size-md); line-height: var(--leading-body); }
56
+ .text-caption { font-size: var(--font-size-sm); line-height: var(--leading-body); }
57
+ .text-strong { font-weight: var(--weight-bold); }
58
+ .text-meta, .meta { font-family: var(--mono); font-size: var(--font-size-xs); letter-spacing: var(--tracking-none); color: var(--muted); }
59
+ .text-label { font-family: var(--mono); font-size: var(--font-size-xs); letter-spacing: var(--tracking-label); }
60
+ .text-caps { font-family: var(--mono); font-size: var(--font-size-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
61
+ .text-tag { font-family: var(--mono); font-size: var(--font-size-2xs); line-height: 1.3333; }
62
+ .text-footnote { font-family: var(--mono); font-size: var(--font-size-2xs); letter-spacing: var(--tracking-note); }
63
+ .text-code { font-family: var(--mono); font-size: var(--font-size-sm); line-height: var(--leading-snug); }
64
+ .muted { color: var(--muted); }
65
+
66
+ /* Blueprint grid background (opt-in): add class="blueprint" to <body> or a section.
67
+ Top of the area only, fades out downwards, crosshair dots on the major lines. Decorative. */
68
+ .blueprint { position: relative; isolation: isolate; }
69
+ .blueprint::before {
70
+ content: ''; position: absolute; inset: 0 0 auto 0; height: min(1100px, 100%); z-index: -1; pointer-events: none;
71
+ background-image:
72
+ linear-gradient(to right, var(--grid) 1px, transparent 1px),
73
+ linear-gradient(to bottom, var(--grid) 1px, transparent 1px),
74
+ linear-gradient(to right, var(--grid-major) 1px, transparent 1px),
75
+ linear-gradient(to bottom, var(--grid-major) 1px, transparent 1px),
76
+ radial-gradient(circle at 50% 50%, var(--grid-dot) 1.5px, transparent 2.5px);
77
+ background-size: var(--grid-size) var(--grid-size), var(--grid-size) var(--grid-size), var(--grid-major-size) var(--grid-major-size), var(--grid-major-size) var(--grid-major-size), var(--grid-major-size) var(--grid-major-size);
78
+ background-position: 0 0, 0 0, 0 0, 0 0, calc(var(--grid-major-size) / -2) calc(var(--grid-major-size) / -2);
79
+ -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
80
+ mask-image: linear-gradient(to bottom, #000, transparent);
81
+ }
82
+
83
+ /* Accessibility and print */
84
+ @media (prefers-reduced-motion: reduce) {
85
+ *, *::before, *::after { animation: none !important; transition: none !important; }
86
+ }
87
+ @media (forced-colors: active) {
88
+ .blueprint::before { display: none; }
89
+ }
90
+ @media print {
91
+ *, *::before, *::after { animation: none !important; transition: none !important; }
92
+ .blueprint::before { display: none; }
93
+ }
@@ -0,0 +1,5 @@
1
+ /* Bereg DS: everything except the optional HDR accents. Import once at the root of your app. */
2
+ @import './fonts.css';
3
+ @import './tokens.css';
4
+ @import './base.css';
5
+ @import './components.css';
@@ -0,0 +1,207 @@
1
+ /* Bereg DS components. Needs tokens.css (and base.css for page defaults).
2
+ Every value comes from a token. Spacing, gaps and radii follow the scale of 4.
3
+ Names match the Figma components: Button, Link, Nav Link, Tag, Card, Quote, Filter Tab, Section Head,
4
+ Facts, Timeline Item, Post Item, Book Promo, Site Header, Site Footer. */
5
+
6
+ @property --tick { syntax: '<length>'; inherits: false; initial-value: 11px; }
7
+
8
+ /* ---------- Button ---------- */
9
+ .btn {
10
+ display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
11
+ padding: var(--space-3) var(--space-5);
12
+ border: var(--border-thin) solid var(--accent); border-radius: var(--radius-sm);
13
+ font-family: var(--mono); font-size: var(--font-size-xs); font-weight: var(--weight-regular);
14
+ letter-spacing: var(--tracking-caps); text-transform: uppercase; line-height: var(--leading-body);
15
+ text-decoration: none; cursor: pointer; background: transparent; color: var(--accent);
16
+ transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast);
17
+ }
18
+ .btn-primary { background: var(--accent); color: var(--accent-ink); }
19
+ .btn-primary:hover { background: var(--highlight); border-color: var(--highlight); color: var(--accent-ink); text-decoration: none; }
20
+ .btn-secondary { color: var(--accent); }
21
+ .btn-secondary:hover { background: var(--accent-subtle); color: var(--accent); text-decoration: none; }
22
+ .btn:disabled, .btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }
23
+
24
+ /* ---------- Link ---------- */
25
+ /* Inline links use the base <a> style. Muted: footer and secondary links. */
26
+ .link-muted { color: var(--muted); }
27
+ .link-muted:hover { color: var(--text); }
28
+
29
+ /* ---------- Nav Link ---------- */
30
+ .nav-link {
31
+ display: inline-block; padding: var(--space-1) 0;
32
+ border-bottom: var(--border-medium) solid transparent;
33
+ color: var(--muted); text-decoration: none;
34
+ font-family: var(--mono); font-size: var(--font-size-xs); letter-spacing: var(--tracking-label);
35
+ }
36
+ .nav-link:hover { color: var(--text); }
37
+ .nav-link[aria-current='page'], .nav-link[aria-current='true'] { color: var(--accent); border-bottom-color: var(--accent); }
38
+
39
+ /* ---------- Tag ---------- */
40
+ .tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 0; padding: 0; list-style: none; }
41
+ .tag, .tags > li {
42
+ font-family: var(--mono); font-size: var(--font-size-2xs); line-height: 1.3333; color: var(--muted);
43
+ border: var(--border-thin) solid var(--line); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-2);
44
+ }
45
+
46
+ /* ---------- Grid layouts ---------- */
47
+ .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--space-6); }
48
+ .grid-4 { grid-template-columns: repeat(auto-fit, minmax(13.75rem, 1fr)); }
49
+ .grid-wide { grid-template-columns: repeat(auto-fill, minmax(18.75rem, 1fr)); }
50
+
51
+ /* ---------- Card (and Quote, Book Promo share the frame) ---------- */
52
+ .card, .quote {
53
+ position: relative; background: var(--surface);
54
+ border: var(--border-thin) solid var(--line); border-radius: var(--radius-sm);
55
+ transition: border-color var(--duration-fast);
56
+ }
57
+ .card { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-2); }
58
+ .card-body { display: flex; flex-direction: column; gap: var(--space-3); }
59
+ .card-title { margin: 0; font-size: var(--font-size-lg); font-weight: var(--weight-semibold); line-height: var(--leading-tight); letter-spacing: var(--tracking-snug); }
60
+ .card-text { margin: 0; color: var(--muted); font-size: var(--font-size-md); }
61
+ /* The title link covers the whole card. */
62
+ .card .stretch { color: inherit; text-decoration: none; }
63
+ .card .stretch::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius-sm); }
64
+
65
+ /* Corner ticks: a blueprint detail. Grow and turn highlight on hover and keyboard focus. */
66
+ .card::before, .quote::before {
67
+ --tc: var(--accent);
68
+ content: ''; position: absolute; inset: -1px; pointer-events: none; opacity: 0.5;
69
+ background:
70
+ linear-gradient(var(--tc), var(--tc)) top left / var(--tick) 1px no-repeat,
71
+ linear-gradient(var(--tc), var(--tc)) top left / 1px var(--tick) no-repeat,
72
+ linear-gradient(var(--tc), var(--tc)) top right / var(--tick) 1px no-repeat,
73
+ linear-gradient(var(--tc), var(--tc)) top right / 1px var(--tick) no-repeat,
74
+ linear-gradient(var(--tc), var(--tc)) bottom left / var(--tick) 1px no-repeat,
75
+ linear-gradient(var(--tc), var(--tc)) bottom left / 1px var(--tick) no-repeat,
76
+ linear-gradient(var(--tc), var(--tc)) bottom right / var(--tick) 1px no-repeat,
77
+ linear-gradient(var(--tc), var(--tc)) bottom right / 1px var(--tick) no-repeat;
78
+ transition: opacity var(--duration-fast), --tick var(--duration-base) var(--ease);
79
+ }
80
+ .card:hover, .card:focus-within { border-color: var(--line-hover); }
81
+ .card:hover::before, .card:focus-within::before { --tick: var(--tick-hover); --tc: var(--highlight); opacity: 1; }
82
+ /* Focus: the ring goes around the whole card, not only around the title link. */
83
+ .card:has(.stretch:focus-visible) { outline: var(--border-thick) solid var(--focus); outline-offset: var(--focus-offset); }
84
+ .card .stretch:focus-visible { outline: none; }
85
+
86
+ /* ---------- Quote ---------- */
87
+ .quotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(18.75rem, 1fr)); gap: var(--space-6); }
88
+ .quote { margin: 0; padding: var(--space-6); display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-4); }
89
+ .quote > p { margin: 0; font-size: var(--font-size-md); }
90
+ .quote-author { font-size: var(--font-size-sm); color: var(--muted); }
91
+ .quote-author strong { display: block; color: var(--text); font-size: var(--font-size-md); }
92
+ .quote-author a { color: inherit; }
93
+
94
+ /* ---------- Book Promo ---------- */
95
+ .book-promo { padding: var(--space-3); gap: var(--space-3); align-items: center; width: max-content; font-family: var(--mono); font-size: var(--font-size-xs); letter-spacing: var(--tracking-note); }
96
+ .book-promo img { width: 7.5rem; height: auto; border: var(--border-thin) solid var(--line); box-shadow: var(--shadow-cover); }
97
+ .book-promo-row { flex-direction: row; gap: var(--space-4); padding-inline-end: var(--space-6); }
98
+ .book-promo-row img { width: 4rem; }
99
+
100
+ /* ---------- Filter Tab ---------- */
101
+ .filters { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-6); padding: 0; list-style: none; }
102
+ .filter-tab {
103
+ display: inline-block; padding: var(--space-2) var(--space-4);
104
+ border: var(--border-thin) solid var(--line-strong); border-radius: var(--radius-sm);
105
+ font-family: var(--mono); font-size: var(--font-size-xs); color: var(--muted); text-decoration: none;
106
+ }
107
+ .filter-tab:hover { color: var(--text); border-color: var(--accent); }
108
+ .filter-tab[aria-current='true'], .filter-tab[aria-current='page'] { background: var(--highlight); color: var(--accent-ink); border-color: var(--highlight); }
109
+
110
+ /* ---------- Section Head ---------- */
111
+ /* Numbered with a CSS counter (put counter-reset: sec on a parent, .sections does it), with a dimension line that draws itself. */
112
+ .sections { counter-reset: sec; }
113
+ .section + .section { margin-top: var(--space-16); }
114
+ .section-head {
115
+ position: relative; display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
116
+ gap: var(--space-4); margin-bottom: var(--space-6); padding-bottom: var(--space-4);
117
+ }
118
+ .section-head::after {
119
+ content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 9px; transform-origin: left center;
120
+ background:
121
+ linear-gradient(var(--line), var(--line)) left bottom / 1px 9px no-repeat,
122
+ linear-gradient(var(--line), var(--line)) right bottom / 1px 9px no-repeat,
123
+ linear-gradient(var(--line), var(--line)) center bottom / 100% 1px no-repeat;
124
+ animation: bds-draw var(--duration-draw) var(--ease) both;
125
+ }
126
+ .section-head h2::before {
127
+ counter-increment: sec;
128
+ content: counter(sec, decimal-leading-zero) ' /';
129
+ content: counter(sec, decimal-leading-zero) ' /' / '';
130
+ font-family: var(--mono); font-size: var(--font-size-xs); font-weight: var(--weight-regular); letter-spacing: var(--tracking-label);
131
+ color: var(--highlight); margin-right: 0.9em; vertical-align: 0.35em;
132
+ }
133
+
134
+ /* ---------- Facts (blueprint title block) ---------- */
135
+ .facts {
136
+ display: grid; grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); gap: 1px;
137
+ margin: 0; padding: 0; list-style: none; background: var(--line); border: var(--border-thin) solid var(--line);
138
+ }
139
+ .facts > li { background: var(--surface); padding: var(--space-4) var(--space-6) var(--space-6); }
140
+ .facts strong { display: block; font-size: var(--font-size-4xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tighter); line-height: var(--leading-tight); }
141
+ .facts span { display: block; color: var(--muted); font-size: var(--font-size-md); }
142
+
143
+ /* ---------- Timeline Item ---------- */
144
+ .timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-6); }
145
+ .timeline > li { display: grid; grid-template-columns: 10rem 1fr; gap: var(--space-6); border-top: var(--border-thin) solid var(--line); padding-top: var(--space-4); }
146
+ .timeline h3 { font-size: var(--font-size-lg); }
147
+ .timeline p { margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--font-size-md); }
148
+
149
+ /* ---------- Post Item ---------- */
150
+ .subhead { font-family: var(--mono); font-size: var(--font-size-xs); font-weight: var(--weight-regular); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--muted); margin: var(--space-8) 0 var(--space-4); }
151
+ .subhead:first-child { margin-top: 0; }
152
+ .posts { list-style: none; margin: 0; padding: 0; }
153
+ .posts > li { border-top: var(--border-thin) solid var(--line); padding: var(--space-4) 0; display: grid; grid-template-columns: 8.125rem 1fr; gap: var(--space-6); }
154
+ .posts h2, .posts h3 { font-size: var(--font-size-xl); }
155
+ .posts h2 a, .posts h3 a { color: var(--text); text-decoration: none; }
156
+ .posts h2 a:hover, .posts h3 a:hover { color: var(--accent); }
157
+ .posts p { margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--font-size-md); }
158
+
159
+ @media (max-width: 40em) {
160
+ .timeline > li, .posts > li { grid-template-columns: 1fr; gap: var(--space-1); }
161
+ }
162
+
163
+ /* ---------- Actions row ---------- */
164
+ .actions { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }
165
+
166
+ /* ---------- Site Header ---------- */
167
+ .site-header { border-bottom: var(--border-thin) solid var(--line); background: var(--header-bg); }
168
+ .site-header > .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); flex-wrap: wrap; min-height: 4.5rem; padding-block: var(--space-2); }
169
+ .brand { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--text); text-decoration: none; font-weight: var(--weight-bold); font-size: var(--font-size-base); letter-spacing: var(--tracking-tight); }
170
+ .brand:hover { color: var(--text); }
171
+ .brand img { height: 2.5rem; width: auto; }
172
+ .site-nav ul { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); list-style: none; margin: 0; padding: 0; }
173
+
174
+ /* ---------- Site Footer ---------- */
175
+ .site-footer { border-top: var(--border-thin) solid var(--line); padding: var(--space-8) 0; color: var(--muted); font-family: var(--mono); font-size: var(--font-size-xs); }
176
+ .site-footer > .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4); }
177
+ .site-footer a { color: var(--muted); }
178
+ .site-footer a:hover { color: var(--text); }
179
+ .site-note { flex-basis: 100%; font-size: var(--font-size-2xs); letter-spacing: var(--tracking-note); }
180
+
181
+ /* ---------- Prose (articles) ---------- */
182
+ .prose { max-width: 68ch; }
183
+ .prose h2 { margin: var(--space-8) 0 var(--space-4); font-size: var(--font-size-2xl); }
184
+ .prose h3 { margin: var(--space-6) 0 var(--space-2); }
185
+ .prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 var(--space-4); }
186
+ .prose li { margin-bottom: var(--space-2); }
187
+ .prose img { border-radius: var(--radius-lg); margin: var(--space-4) 0; }
188
+ .prose code { font-family: var(--mono); font-size: 0.9em; background: var(--surface); border: var(--border-thin) solid var(--line); border-radius: var(--radius-sm); padding: 0 var(--space-1); }
189
+ .prose pre { max-width: 100%; background: var(--surface); border: var(--border-thin) solid var(--line); border-radius: var(--radius-sm); padding: var(--space-4); overflow-x: auto; font-size: var(--font-size-sm); line-height: var(--leading-snug); }
190
+ .prose pre code { background: none; border: 0; padding: 0; }
191
+ .prose blockquote { border-left: var(--border-thick) solid var(--accent); margin: var(--space-4) 0; padding: 0 var(--space-4); color: var(--muted); }
192
+ .prose table { width: 100%; border-collapse: collapse; font-size: var(--font-size-sm); }
193
+ .prose th, .prose td { padding: var(--space-2) var(--space-3); border-bottom: var(--border-thin) solid var(--line); text-align: left; vertical-align: top; }
194
+ .prose th { font-family: var(--mono); font-size: var(--font-size-2xs); font-weight: var(--weight-regular); color: var(--muted); }
195
+
196
+ /* ---------- Motion ---------- */
197
+ @keyframes bds-draw { from { transform: scaleX(0); } }
198
+ @keyframes bds-rise { from { opacity: 0; transform: translateY(14px); } }
199
+ @supports (animation-timeline: view()) {
200
+ .section-head::after { animation: bds-draw linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
201
+ }
202
+
203
+ /* ---------- Forced colors (Windows high contrast) ---------- */
204
+ @media (forced-colors: active) {
205
+ .card::before, .quote::before, .section-head::after { display: none; }
206
+ .btn-primary, .filter-tab[aria-current='true'], .filter-tab[aria-current='page'] { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
207
+ }
@@ -0,0 +1,12 @@
1
+ /* Bereg DS fonts: IBM Plex Sans (variable, 100-700) and IBM Plex Mono 400, self-hosted through Fontsource.
2
+ The font files and their OFL license come with the @fontsource packages (dependencies of bereg-ds).
3
+ Each subset has its own unicode-range, so the browser loads only the scripts a page uses (latin, cyrillic...).
4
+ For Hebrew use IBM Plex Sans Hebrew (@fontsource/ibm-plex-sans-hebrew) and add it to --font in your project. */
5
+ @import '@fontsource-variable/ibm-plex-sans/wght.css';
6
+ @import '@fontsource/ibm-plex-mono/400.css';
7
+
8
+ /* Metric-matched fallbacks: system fonts scaled to Plex's size and line box, so the font swap does not shift layout.
9
+ Variable names in tokens.css (--font, --mono) list these right after Plex. */
10
+ @font-face { font-family: 'IBM Plex Sans Fallback'; font-weight: 100 500; src: local('Arial'); size-adjust: 100.8%; ascent-override: 101.7%; descent-override: 27.3%; line-gap-override: 0%; }
11
+ @font-face { font-family: 'IBM Plex Sans Fallback'; font-weight: 600 900; src: local('Arial Bold'), local('Arial-BoldMT'); size-adjust: 98.7%; ascent-override: 103.8%; descent-override: 27.9%; line-gap-override: 0%; }
12
+ @font-face { font-family: 'IBM Plex Mono Fallback'; src: local('Courier New'); size-adjust: 100%; ascent-override: 102.5%; descent-override: 27.5%; line-gap-override: 0%; }
@@ -0,0 +1,37 @@
1
+ /* Bereg DS HDR accents (optional). Not part of the default style: use only for single accents,
2
+ for example one logo or one card. Everything has an SDR fallback, so nothing disappears on normal screens.
3
+ HDR assets (Ultra HDR JPEG with a gain map) can be made with https://glow.bereg.dev.
4
+
5
+ Usage:
6
+ <img class="hdr-logo" src="logo-hdr.jpg" alt=""> logo on a black background, black disappears
7
+ <article class="card hdr-card" style="--hdr-swatch: url(swatch.jpg)"> border and title glow on HDR screens */
8
+
9
+ /* Logo exported on black: "screen" removes the black so the logo sits on any dark background. */
10
+ .hdr-logo { mix-blend-mode: screen; }
11
+
12
+ .hdr-card .stretch, .hdr-card .card-title { color: var(--text); }
13
+
14
+ @media (dynamic-range: high) {
15
+ .hdr-card {
16
+ border: var(--border-medium) solid transparent;
17
+ padding: calc(var(--space-6) - 1px);
18
+ background:
19
+ linear-gradient(var(--surface), var(--surface)) padding-box,
20
+ linear-gradient(color-mix(in oklab, var(--bg) 40%, transparent), color-mix(in oklab, var(--bg) 40%, transparent)) border-box,
21
+ var(--hdr-swatch, none) center / cover border-box,
22
+ linear-gradient(var(--accent), var(--accent)) border-box;
23
+ }
24
+ @supports (background-clip: text) or (-webkit-background-clip: text) {
25
+ .hdr-card .stretch, .hdr-card .hdr-text {
26
+ background: var(--hdr-swatch, none) center / cover, linear-gradient(var(--text), var(--text));
27
+ -webkit-background-clip: text;
28
+ background-clip: text;
29
+ color: transparent;
30
+ }
31
+ }
32
+ }
33
+
34
+ @media (forced-colors: active) {
35
+ .hdr-card { background: Canvas; border-color: CanvasText; }
36
+ .hdr-card .stretch, .hdr-card .hdr-text { background: none; color: LinkText; }
37
+ }