/* =====================================================================
 * Ezencia Zen — design tokens. SINGLE SOURCE OF TRUTH.
 * Used by: ezencia-zen/index.html (page + canvas shader read these at runtime)
 *          and the dashboard (dashboard.felixrohde.com).
 * JSON mirror: tokens/ezencia-zen.json (generated from the same values).
 *
 * Themes:  :root / [data-theme="chalk"]  = the garden by day (default)
 *          [data-theme="anthracite"]       = the anthracite garden (dashboard, night)
 * One accent: moss. One action colour per ground: the ink fill.
 * Fonts are self-hosted woff2 in ezencia-zen/fonts/ (latin subset).
 * ===================================================================== */

:root,
[data-theme="chalk"] {
  color-scheme: light;
  --ez-garden-mode: 0;   /* shader: 0 = light ground (shaded grooves), 1 = dark ground (chalk-lit grooves) */
  /* colour */
  --ez-ground: #E6E6E1;  /* Page ground and the smooth (unraked) beds that carry text. Chalk gravel by day, anthracite gravel by night. */
  --ez-ground-raked: #E2E2DD;  /* Base colour of the raked ground drawn by the canvas shader. */
  --ez-ground-sunk: #D7D7D1;  /* The garden at dusk: the close of a page, wells, quiet panels. */
  --ez-ground-lit: #F7F7F3;  /* Light edge of a rake groove; light stroke of drawn single-line marks. */
  --ez-ink: #232627;  /* Primary text and the primary action fill. Anthracite on chalk, chalk on anthracite. [12.2:1 on ground] */
  --ez-ink-strong: #141617;  /* Hover of the primary action; emphasis. */
  --ez-ink-2: #464A4B;  /* Secondary text. [7.2:1 on ground] */
  --ez-ink-3: #535759;  /* Tertiary text, hints, captions (still >= 4.5:1 on ground). [5.8:1 on ground] */
  --ez-ink-placeholder: #535759;  /* Input placeholder. [5.8:1 on ground] */
  --ez-on-ink: #E6E6E1;  /* Text on an ink-filled control (the primary action). */
  --ez-accent: #4D6B3C;  /* The one accent, moss: the living thing in a stone garden. Breath state, active state, progress, the primary action's hover mark. Never a fill behind body text. */
  --ez-accent-ink: #3C5530;  /* Accent used as text (>= 4.5:1 on ground). [6.6:1 on ground] */
  --ez-accent-soft: #C8DDB8;  /* Accent on a stone (e.g. the breathing count while inhaling). */
  --ez-on-accent: #EEF1EA;  /* Text on an accent fill. */
  --ez-err: #8A2F22;  /* Form errors only. [6.7:1 on ground] */
  --ez-stone-lit: #6E7273;  /* Stone: lit face (shader). Basalt in both themes; by night the highlight is lifted. */
  --ez-stone-shade: #121415;  /* Stone: shadow face (shader). */
  --ez-stone-rim: #000000;  /* Cool rim light on the stone edge (shader, additive). #000000 = no rim by day. */
  --ez-stone-hi: #5A5E5F;  /* Stone CSS fallback gradient, light. */
  --ez-stone: #2A2D2E;  /* Stone CSS fallback gradient, body. */
  --ez-stone-lo: #17191A;  /* Stone CSS fallback gradient, edge. */
  --ez-count: #E6E8E2;  /* Numerals engraved on a stone. */
  --ez-rake-line: #000000;  /* Additive line colour of the rake in the dark garden (shader); unused by day. */
  --ez-scroll-thumb: #7C8081;  /* Scrollbar thumb. */
  --ez-rake-1: #E4E4DF;  /* No-JS raked fallback stripe 1. */
  --ez-rake-2: #F1F1EC;  /* No-JS fallback stripe 2 (light edge). */
  --ez-rake-3: #DADAD4;  /* No-JS fallback stripe 3. */
  --ez-rake-4: #C6C7C1;  /* No-JS fallback stripe 4 (groove). */
  --ez-rake-5: #DFDFDA;  /* No-JS fallback stripe 5. */
  --ez-shadow-action: 0 10px 22px -14px rgba(20,22,23,.7);  /* soft, offset; never a hard block shadow */
}

[data-theme="anthracite"] {
  color-scheme: dark;
  --ez-garden-mode: 1;   /* shader: 0 = light ground (shaded grooves), 1 = dark ground (chalk-lit grooves) */
  /* colour */
  --ez-ground: #2B2E2F;  /* Page ground and the smooth (unraked) beds that carry text. Chalk gravel by day, anthracite gravel by night. */
  --ez-ground-raked: #2A2D2E;  /* Base colour of the raked ground drawn by the canvas shader. */
  --ez-ground-sunk: #222526;  /* The garden at dusk: the close of a page, wells, quiet panels. */
  --ez-ground-lit: #5A5F60;  /* Light edge of a rake groove; light stroke of drawn single-line marks. */
  --ez-ink: #E9E9E4;  /* Primary text and the primary action fill. Anthracite on chalk, chalk on anthracite. [11.2:1 on ground] */
  --ez-ink-strong: #FFFFFF;  /* Hover of the primary action; emphasis. */
  --ez-ink-2: #C4C7C3;  /* Secondary text. [8.0:1 on ground] */
  --ez-ink-3: #A2A6A3;  /* Tertiary text, hints, captions (still >= 4.5:1 on ground). [5.6:1 on ground] */
  --ez-ink-placeholder: #9CA09D;  /* Input placeholder. [5.2:1 on ground] */
  --ez-on-ink: #232627;  /* Text on an ink-filled control (the primary action). */
  --ez-accent: #9EBF86;  /* The one accent, moss: the living thing in a stone garden. Breath state, active state, progress, the primary action's hover mark. Never a fill behind body text. */
  --ez-accent-ink: #ABC994;  /* Accent used as text (>= 4.5:1 on ground). [7.5:1 on ground] */
  --ez-accent-soft: #C8DDB8;  /* Accent on a stone (e.g. the breathing count while inhaling). */
  --ez-on-accent: #1B2614;  /* Text on an accent fill. */
  --ez-err: #F0A08C;  /* Form errors only. [6.6:1 on ground] */
  --ez-stone-lit: #8E9599;  /* Stone: lit face (shader). Basalt in both themes; by night the highlight is lifted. */
  --ez-stone-shade: #0C0E0F;  /* Stone: shadow face (shader). */
  --ez-stone-rim: #9DB0BE;  /* Cool rim light on the stone edge (shader, additive). #000000 = no rim by day. */
  --ez-stone-hi: #6E7579;  /* Stone CSS fallback gradient, light. */
  --ez-stone: #262A2C;  /* Stone CSS fallback gradient, body. */
  --ez-stone-lo: #101213;  /* Stone CSS fallback gradient, edge. */
  --ez-count: #E6E8E2;  /* Numerals engraved on a stone. */
  --ez-rake-line: #EFEFEA;  /* Additive line colour of the rake in the dark garden (shader); unused by day. */
  --ez-scroll-thumb: #6A6F70;  /* Scrollbar thumb. */
  --ez-rake-1: #2D3031;  /* No-JS raked fallback stripe 1. */
  --ez-rake-2: #3A3E3F;  /* No-JS fallback stripe 2 (light edge). */
  --ez-rake-3: #272A2B;  /* No-JS fallback stripe 3. */
  --ez-rake-4: #1E2021;  /* No-JS fallback stripe 4 (groove). */
  --ez-rake-5: #2B2E2F;  /* No-JS fallback stripe 5. */
  --ez-shadow-action: 0 10px 26px -14px rgba(0,0,0,.9);  /* soft, offset; never a hard block shadow */
}

:root {
  /* derived colour roles (follow the theme automatically) */
  --ez-line: color-mix(in srgb, var(--ez-ink) 16%, transparent);
  --ez-line-strong: color-mix(in srgb, var(--ez-ink) 30%, transparent);
  --ez-field: color-mix(in srgb, var(--ez-ground-lit) 55%, transparent);
  --ez-field-hover: color-mix(in srgb, var(--ez-ground-lit) 75%, transparent);
  --ez-field-focus: color-mix(in srgb, var(--ez-ground-lit) 90%, transparent);
  --ez-focus-ring: var(--ez-ink);
  --ez-focus-halo: color-mix(in srgb, var(--ez-ground) 90%, transparent);
  --ez-selection-bg: var(--ez-ink);
  --ez-selection-fg: var(--ez-ground);
  /* type, space, radii, motion, rake (theme-independent) */
  --ez-font-display: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;  /* Display: Zen Old Mincho 400/700/900, upright, never italic. */
  --ez-font-body: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, sans-serif;  /* Body and UI: Zen Kaku Gothic New 400/500/700. */
  --ez-fw-display: 700;
  --ez-fw-statement: 400;
  --ez-fw-body: 400;
  --ez-fw-ui: 500;
  --ez-fs-display: clamp(3rem, 7.4vw, 6rem);  /* H1. */
  --ez-fs-h2: clamp(2.15rem, 4.2vw, 3.6rem);  /* Section heading. */
  --ez-fs-h3: clamp(1.8rem, 2.6vw, 2.35rem);  /* Item heading. */
  --ez-fs-statement: clamp(1.55rem, 2.75vw, 2.45rem);  /* Mincho 400 statement. */
  --ez-fs-second: clamp(1.4rem, 2.3vw, 2.05rem);  /* Mincho 400 second line. */
  --ez-fs-lede: clamp(1.0625rem, 1.35vw, 1.25rem);
  --ez-fs-body: 1.0625rem;
  --ez-fs-body-m: 1rem;  /* Body on phones. */
  --ez-fs-small: 0.9rem;  /* Hints, captions (never below 0.8rem / 12.8px). */
  --ez-fs-figure: clamp(2rem, 3.4vw, 2.8rem);  /* Dashboard figures (tabular numerals). */
  --ez-fs-count: 5.4rem;  /* Breathing count on a stone. */
  --ez-lh-body: 1.72;
  --ez-lh-display: 1.02;
  --ez-tracking-display: -0.025em;
  --ez-space-1: 4px;
  --ez-space-2: 8px;
  --ez-space-3: 12px;
  --ez-space-4: 16px;
  --ez-space-5: 24px;
  --ez-space-6: 32px;
  --ez-space-7: 48px;
  --ez-space-8: 64px;
  --ez-space-9: 96px;
  --ez-space-10: 128px;
  --ez-gutter: clamp(16px, 4.4vw, 72px);  /* Page side gutter. */
  --ez-bed-pad: clamp(22px, 2.6vw, 40px);  /* Inner padding of a text bed. */
  --ez-space-section: clamp(110px, 15vh, 190px);  /* Raked garden between sections. */
  --ez-space-section-m: 96px;
  --ez-r-action: 3px;  /* Buttons and inputs: a small, cut corner. Never a pill. */
  --ez-r-photo: 4px;
  --ez-r-bed-xs: 18px;
  --ez-r-bed-s: 20px;
  --ez-r-bed-m: 30px;
  --ez-r-bed-l: 40px;
  --ez-r-bed-xl: 46px;
  --ez-r-bed-xxl: 52px;
  --ez-r-bed-hero: 64px;  /* Bed radii: organic islands in the gravel (also read by the canvas). */
  --ez-ease-out: cubic-bezier(.16, 1, .3, 1);  /* Default exponential ease-out. */
  --ez-ease-inout: cubic-bezier(.45, 0, .2, 1);  /* Stroke draw-in. */
  --ez-dur-fast: 300ms;
  --ez-dur-base: 500ms;
  --ez-dur-slow: 2400ms;  /* Single-stroke draw-in. */
  --ez-breath-in: 4s;  /* Inhale. */
  --ez-breath-out: 6s;  /* Exhale. */
  --ez-rake-gap: 7.5px;  /* Distance between rake lines (canvas). */
  --ez-rake-gap-compact: 6.5px;  /* Rake gap below 700px width. */
}
