/* app/static/tokens.css - WEVA-W-222: the design tokens, in one file.
 *
 * This file is the only place the member shell's colours, spacing, radii,
 * shadows, type sizes and motion durations are defined (W-222 criterion 1).
 * `shell.css` and every page built on it read these custom properties and
 * never write a colour, a size or a duration of their own.
 *
 * Source of the values: the colours are W-221's brand tokens (section 1);
 * the rest follows the approved Version 2 prototype (docs/design/portal_v2/,
 * Mat 2026-10-13): the surface mixes of its v2b.css layer, the spacing tokens of v2h.css (concept
 * revision 4, point 1: "spacing comes only from the shared tokens"), and its
 * type scale (v2.css "typography scale, one system").
 *
 * Four sections:
 *   1. PALETTE        - raw brand colours, dark (default) and light.
 *                       Mapped onto W-221's generated brand tokens
 *                       (app/static/brand/tokens.css); this file names no
 *                       hex value of its own.
 *   2. MEMBER         - the per-member accent and background hooks that
 *                       Settings (W-231) overrides per mode (light again
 *                       since WEVA-W-299), over the light preset the brand
 *                       file applies (WEVA-W-262's sets, off by default).
 *   3. SEMANTIC       - what the shell actually uses (surfaces, lines,
 *                       shadows, spacing, radii, type, motion, layers),
 *                       derived from 1 and 2 only.
 *   4. LEGACY ALIASES - the older stylesheets (weva.css, pilot/glass.css,
 *                       pilot/app.css) still style the content of pages that
 *                       W-224 onwards rebuild; inside the member shell their
 *                       variable names point at these tokens, so an existing
 *                       page takes the new palette without its own edit.
 *
 * Loaded on every page, right after brand/tokens.css, so it must define
 * custom properties only,
 * plus the single global rule at the very end that every page needs.
 */

/* ======================================================= 1. PALETTE ======
 * BEGIN PALETTE
 * Every value here reads W-221's generated brand tokens
 * (app/static/brand/tokens.css, from scripts/make_brand_assets.py and
 * docs/brand/brand_profile.md), which _layout.html links before this file.
 * No hex value is repeated here: a colour the brand list does not name is
 * mixed from colours it does, so a palette change in the generator reaches
 * the whole shell. The brand file switches its values under
 * :root[data-theme="light"]; the few lines below that differ by mode do so
 * because a different brand colour plays the role in light mode (the
 * shadow hue, the top highlight, text on a green fill). */
:root {
  --p-ground:        var(--brand-ground);
  --p-ground-2:      var(--brand-ground-2);
  --p-surface:       var(--brand-surface);
  --p-surface-2:     color-mix(in srgb, var(--brand-surface), var(--brand-accent) 8%);
  --p-violet:        var(--brand-accent);
  --p-violet-bright: var(--brand-accent-bright);
  --p-lavender:      var(--brand-lavender);
  --p-blue:          var(--brand-blue);
  --p-text:          var(--brand-text);
  --p-text-2:        var(--brand-text-2);
  --p-text-3:        color-mix(in srgb, var(--brand-text-2) 80%, var(--brand-ground));   /* fine print, placeholders */
  --p-desc:          color-mix(in srgb, var(--brand-text) 30%, var(--brand-text-2));     /* card descriptions */
  --p-ok:            var(--brand-ok-text);
  --p-ok-deep:       color-mix(in srgb, var(--brand-ok) 75%, var(--brand-ground-2));
  --p-warn:          var(--brand-warn-text);
  --p-err:           var(--brand-error-text);
  --p-line:          var(--brand-lavender);   /* the hue of hairlines (used at low alpha) */
  --p-shadow:        var(--brand-ground);     /* the hue of shadows (used at low alpha) */
  --p-shine:         var(--brand-text);       /* the hue of top highlights */
  --p-on-accent:     var(--brand-on-accent);
  --p-on-ok:         color-mix(in srgb, var(--brand-ok) 25%, var(--brand-ground));
  --p-sky-a:         var(--brand-accent);
  --p-sky-b:         var(--brand-blue);
  --p-sky-line-a:    var(--brand-accent-bright);
  --p-sky-line-b:    color-mix(in srgb, var(--brand-blue) 70%, var(--brand-text));

  /* the defaults for the member hooks in section 2: the brand accent and
     ground. WEVA-W-262: the account menu's base-colour and glass picker
     (W-094, --base-dark / --base-light / --glass-intensity on <html>) is
     retired, so nothing from the device sits under them any more.
     WEVA-W-299: light mode has its own hooks again; their defaults are the
     light block's brand accent and ground, i.e. the chosen preset's (the
     brand file switches them with <html data-light-set>), since these
     resolve on the same <html> element as data-theme. */
  --p-default-accent-dark:  var(--brand-accent);
  --p-default-bg-dark:      var(--brand-ground);
  --p-default-accent-light: var(--brand-accent);
  --p-default-bg-light:     var(--brand-ground);
}

:root[data-theme="light"] {
  --p-shadow:        var(--brand-text);       /* the hue a fill is shaded toward */
  --p-shine:         var(--brand-surface);
  /* the light-mode green is dark: light text on it. WEVA-W-299: no longer the
     on-accent colour, which is the dark Night label now (3.1:1 on that green);
     the set's surface (White, or Ochre's Cream White) reads at 6.4:1 or more. */
  --p-on-ok:         var(--brand-surface);
  /* WEVA-W-262 criterion 4: the background's two lights are the light set's own
     glows (brand file, --brand-glow-1 / --brand-glow-2), never dark mode's.
     WEVA-W-316 criterion 8: through --p-glow-1 / --p-glow-2, which the member's
     stylesheet sets to their light accent's own two glows on Paper (and Rose's own
     pair on Ochre); Blue Hour keeps its two pale blues, Ochre its honey and apricot.
     app/static/hero/hero.css reads the same two. */
  --p-glow-1:        var(--brand-glow-1);
  --p-glow-2:        var(--brand-glow-2);
  --p-sky-a:         var(--p-glow-1);
  --p-sky-b:         var(--p-glow-2);
  --p-sky-line-a:    var(--p-glow-1);
  --p-sky-line-b:    color-mix(in srgb, var(--p-glow-2) 70%, var(--brand-text));
}
/* END PALETTE */

/* ======================================================== 2. MEMBER ======
 * Settings (W-231) stores a member's own accent and background, separately
 * for dark and light, and applies them by overriding these four properties
 * (in the stylesheet served for that member, loaded after this file). Until
 * then they are the palette's own values. Everything in section 3 that tints
 * a surface reads --c-accent / --c-bg, so one override recolours the whole
 * shell. WEVA-W-299 criterion 5: light mode has its own accent and
 * background again; the light preset (WEVA-W-262's sets, off by default) is
 * the base they lie over, as the brand's dark lies under the dark choices. */
:root {
  --member-accent-dark:  var(--p-default-accent-dark);
  --member-bg-dark:      var(--p-default-bg-dark);
  --member-accent-light: var(--p-default-accent-light);
  --member-bg-light:     var(--p-default-bg-light);

  --c-accent: var(--member-accent-dark);
  --c-bg:     var(--member-bg-dark);
}
:root[data-theme="light"] {
  --c-accent: var(--member-accent-light);
  --c-bg:     var(--member-bg-light);
}
/* WEVA-W-315: the colours of the member shell's mark (app/templates/_shell_mark.html,
 * painted by shell.css). Option C, the brand's own logo colours, until the member's
 * stylesheet sets them from their own accent: the dark accent in its dark block
 * (app/appearance.py, the generator's derivation) and, since WEVA-W-316, the light
 * accent in its light block (`light_logo_for_accent`). A member on Weva's own accent
 * keeps option C in both modes. */
:root,
:root[data-theme="light"] {
  --logo-ribbon-light: var(--brand-logo-ribbon-light);
  --logo-ribbon-mid:   var(--brand-logo-ribbon-mid);
  --logo-ribbon-deep:  var(--brand-logo-ribbon-deep);
  --logo-fold-light:   var(--brand-logo-fold-light);
  --logo-fold-deep:    var(--brand-logo-fold-deep);
}

/* ====================================================== 3. SEMANTIC ======
 * Colours that differ by mode in more than their palette value (how much of
 * a hue goes into a surface) are set in both blocks; everything else is set
 * once and follows the palette. */
:root {
  color-scheme: dark;

  /* ---- colour: text and accent ---- */
  --c-text:         var(--p-text);
  --c-text-2:       var(--p-text-2);
  --c-text-3:       var(--p-text-3);
  --c-desc:         var(--p-desc);
  --c-accent-2:     var(--p-violet-bright);
  --c-accent-soft:  var(--p-lavender);
  --c-blue:         var(--p-blue);
  --c-ok:           var(--p-ok);
  --c-ok-deep:      var(--p-ok-deep);
  --c-warn:         var(--p-warn);
  --c-err:          var(--p-err);
  --c-on-accent:    var(--p-on-accent);
  --c-on-ok:        var(--p-on-ok);
  /* WEVA-W-236 criterion 8b: the fill a label or a small mark sits on (the primary
     button, the avatar, the nav badge, list and circle marks, the upload icons).
     With Weva's own accent it is the brand's accent-fill, shaded toward the shadow
     hue, which carries the brand's label at 4.5:1 or more in both modes (W-235
     round 4). A member's own accent replaces both ends from their stylesheet
     (app/appearance.py: the accent's lighter tone to the accent), where W-231's
     label rule chose --c-on-accent for exactly those two ends. */
  --c-fill-a:       var(--brand-accent-fill);
  --c-fill-b:       color-mix(in srgb, var(--brand-accent-fill) 80%, var(--p-shadow));
  /* WEVA-W-299 criterion 1a: the primary button's 1 px edge. None in dark (the
     amber reads 8.6:1 on Night); in light the deep accent, so the bright amber
     fill (about 2:1 on a light ground) has an edge at 3:1 or more. For the
     primary button's border-color (shell.css `.shell-v2 .btn.primary`) and the
     accent-filled current step and switch in upload.css (round 2, note 2). */
  --c-fill-edge:    transparent;
  /* WEVA-W-316: light mode's accent tones (the generated brand tokens' light rows; a
     member's own light accent sets them from app/appearance.py). In dark mode they
     follow the accent as before, so nothing in dark mode changes: the edge (the
     button's edge, meaningful icons, the focus ring) and the decorative icon tone are
     the accent, the hover fill is the fill. */
  --c-accent-edge:  var(--c-accent);
  --c-accent-decor: var(--c-accent-2);
  --c-fill-hover:   var(--c-fill-a);
  --c-fill-hover-bg: linear-gradient(135deg, var(--c-fill-a), var(--c-fill-b));
  --c-switch-on:    linear-gradient(135deg, var(--c-accent-2), var(--c-accent));
  /* WEVA-W-316 R1: every button's edge (shell.css .btn): 1 px of the hairline in dark,
     2 px of the accent's edge tone in light; the hover lightens in dark only. */
  --btn-edge-width:   1px;
  --btn-line:         var(--c-line-strong);
  --btn-line-hover:   var(--c-line-hover);
  --btn-hover-filter: brightness(1.08);
  /* WEVA-W-316 criterion 5: the current menu item's text and icon (dark: the text). */
  --c-nav-current:      var(--c-text);
  --c-nav-icon-current: currentColor;
  /* WEVA-W-316 criterion 6: the hero's and the category tiles' icons
     (static/hero/hero_icons.svg, static/category_icons.svg) draw in the logo tokens in
     dark mode and in the accent's decorative tone in light mode. */
  --icon-ribbon-light: var(--brand-logo-ribbon-light);
  --icon-ribbon-mid:   var(--brand-logo-ribbon-mid);
  --icon-ribbon-deep:  var(--brand-logo-ribbon-deep);
  --icon-fold-light:   var(--brand-logo-fold-light);
  --icon-fold-deep:    var(--brand-logo-fold-deep);
  --c-surface:      var(--p-surface);
  --c-surface-2:    var(--p-surface-2);

  /* ---- colour: lines ---- */
  --c-line:         color-mix(in srgb, var(--p-line) 13%, transparent);
  --c-line-strong:  color-mix(in srgb, var(--p-line) 22%, transparent);
  --c-line-hover:   color-mix(in srgb, var(--p-line) 42%, transparent);
  --c-line-accent:  color-mix(in srgb, var(--c-accent-soft) 55%, transparent);

  /* ---- colour: accent washes ---- */
  --c-accent-wash:   color-mix(in srgb, var(--c-accent) 14%, transparent);
  --c-accent-wash-2: color-mix(in srgb, var(--c-accent) 26%, transparent);
  --c-accent-glow:   color-mix(in srgb, var(--c-accent) 42%, transparent);
  /* WEVA-W-299 round 3 (WEVA-6248): the text selection, a wash of the member's accent
     under --c-text (app/static/shell.css ::selection), in both modes (--c-accent is the
     mode's). The 24 % is scripts/make_brand_assets.py's SELECTION_WASH, whose
     check_floors() holds the text at 4.5:1 on it; change both together. */
  --c-selection:     color-mix(in srgb, var(--c-accent) 24%, transparent);
  /* WEVA-W-262 round 2 (WEVA-2935): a status chip draws its word on these washes. The
     14 % is scripts/make_brand_assets.py's STATUS_WASH, against which each light set's
     status words are computed (4.55:1 on the wash over ground-2); change both together. */
  --c-ok-wash:       color-mix(in srgb, var(--c-ok) 14%, transparent);
  --c-warn-wash:     color-mix(in srgb, var(--c-warn) 14%, transparent);
  --c-err-wash:      color-mix(in srgb, var(--c-err) 14%, transparent);

  /* ---- colour: surfaces (tinted from the member's background) ---- */
  --c-col-top:      color-mix(in srgb, color-mix(in srgb, var(--c-bg), var(--p-shine) 5%) 84%, transparent);
  --c-col-bottom:   color-mix(in srgb, var(--c-bg) 88%, transparent);
  --c-top-veil:     color-mix(in srgb, var(--c-bg) 86%, transparent);
  /* how much of the panel is solid: 72 % and 82 % (WEVA-W-262: the glass
     intensity picker that moved these is retired; these are its default, 3) */
  --c-panel-from:   color-mix(in srgb, color-mix(in srgb, var(--c-bg), var(--p-shine) 9%) 72%, transparent);
  --c-panel-to:     color-mix(in srgb, color-mix(in srgb, var(--c-bg), var(--p-shine) 3%) 82%, transparent);
  --c-panel-accent: color-mix(in srgb, var(--c-accent) 18%, transparent);
  --c-hero-from:    color-mix(in srgb, var(--c-bg), var(--c-accent) 10%);
  --c-hero-to:      color-mix(in srgb, var(--c-bg), var(--p-shine) 2%);
  --c-hero-glow:    color-mix(in srgb, var(--c-accent) 30%, transparent);
  --c-field:        color-mix(in srgb, var(--p-ground) 55%, transparent);
  --c-control:      color-mix(in srgb, var(--p-surface) 70%, transparent);
  --c-menu:         color-mix(in srgb, var(--p-surface) 97%, transparent);
  --c-scrim:        color-mix(in srgb, var(--p-ground) 62%, transparent);
  --c-highlight:    color-mix(in srgb, var(--p-shine) 6%, transparent);
  --c-light:        color-mix(in srgb, var(--c-accent-soft) 16%, transparent);  /* cursor light */
  --c-orbit-mid:    color-mix(in srgb, var(--c-accent-soft) 45%, transparent);
  --c-orbit-head:   color-mix(in srgb, var(--p-shine) 92%, var(--c-accent-soft));
  --c-sheen:        color-mix(in srgb, var(--p-shine) 28%, transparent);   /* primary button sweep */

  /* ---- colour: the sky ---- */
  --c-sky-a:        color-mix(in srgb, var(--p-sky-a) 18%, transparent);
  --c-sky-b:        color-mix(in srgb, var(--p-sky-b) 13%, transparent);
  --c-sky-line-a:   var(--p-sky-line-a);
  --c-sky-line-b:   var(--p-sky-line-b);
  --c-sky-line-end: var(--p-sky-b);
  --sky-line-opacity: .7;
  --c-ground-glow-a: color-mix(in srgb, var(--c-accent) 22%, transparent);
  --c-ground-glow-b: color-mix(in srgb, var(--p-sky-b) 16%, transparent);

  /* ---- shadows ---- */
  --shadow-panel:       0 12px 28px color-mix(in srgb, var(--p-shadow) 32%, transparent),
                        inset 0 1px 0 var(--c-highlight);
  --shadow-card:        0 10px 24px color-mix(in srgb, var(--p-shadow) 28%, transparent),
                        inset 0 1px 0 var(--c-highlight);
  --shadow-card-hover:  0 16px 34px color-mix(in srgb, var(--p-shadow) 45%, transparent),
                        0 0 24px color-mix(in srgb, var(--c-accent) 16%, transparent);
  --shadow-column:      0 0 32px color-mix(in srgb, var(--p-shadow) 25%, transparent);
  --shadow-menu:        0 18px 40px color-mix(in srgb, var(--p-shadow) 55%, transparent);
  --shadow-dialog:      0 26px 64px color-mix(in srgb, var(--p-shadow) 55%, transparent),
                        inset 0 1px 0 var(--c-highlight);
  --shadow-primary:     0 8px 24px color-mix(in srgb, var(--c-accent) 42%, transparent),
                        inset 0 1px 0 color-mix(in srgb, var(--p-shine) 25%, transparent);
  --shadow-selected:    inset 0 0 0 1px color-mix(in srgb, var(--c-accent-soft) 26%, transparent),
                        0 0 22px color-mix(in srgb, var(--c-accent) 16%, transparent);
  --focus-ring:         0 0 0 4px color-mix(in srgb, var(--c-accent) 18%, transparent);
  --focus-outline:      2px solid var(--c-accent-soft);

  /* ---- spacing (concept revision 4, point 1) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;

  --page-pad-x:      28px;      /* the page container's side padding */
  --page-pad-top:    8px;
  --page-pad-bottom: 40px;
  --section-gap:     20px;      /* between sections of a page */
  --card-gap:        14px;      /* between cards in a list or grid */
  --card-pad-y:      16px;      /* inside a card */
  --card-pad-x:      18px;
  --card-pad:        var(--card-pad-y) var(--card-pad-x);
  --column-pad:      18px;      /* inside the left and right columns */
  --column-gap:      18px;      /* between blocks of a column */
  --control-pad-y:   10px;
  --control-pad-x:   16px;

  /* ---- radii ---- */
  --radius-card:    18px;
  --radius-panel:   22px;       /* hero panel */
  --radius-control: 12px;       /* buttons, fields, dropdown */
  --radius-menu:    14px;
  --radius-small:   8px;
  --radius-pill:    999px;

  /* ---- shell geometry ---- */
  --shell-left-w:   240px;
  --shell-right-w:  284px;
  --shell-top-h:    80px;
  --shell-drawer-w: min(300px, 86vw);
  --avatar-size:    40px;
  --icon-size:      18px;
  --hit-size:       44px;       /* touch target */
  /* WEVA-W-236 criterion 4: the skill card's icon tile (the prototype's ~76 px
     square) and the category glyph inside it, one value for every card */
  --card-icon-size:  76px;
  --card-icon-glyph: 44px;

  /* ---- type: Inter, one scale on every page (concept rev. 3, point 4) ---- */
  --font-ui:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-hero:       clamp(2rem, 1.35rem + 2.2vw, 2.6rem);   /* hero heading */
  --fs-page:       clamp(1.75rem, 1.25rem + 1.6vw, 2.25rem); /* page heading */
  --fs-top-title:  1.5rem;      /* the header's title */
  --fs-section:    1.375rem;    /* section heading */
  --fs-card-title: 1.0625rem;   /* card title */
  --fs-body:       0.9375rem;   /* body copy */
  --fs-desc:       0.875rem;    /* card description */
  --fs-meta:       0.75rem;     /* meta line, counts */
  --fs-badge:      0.6875rem;   /* category badge, chip */
  --fs-eyebrow:    0.6875rem;   /* eyebrow above a heading */
  --fs-stat:       1.45rem;     /* number in a stat row */
  --lh-tight:  1.08;
  --lh-snug:   1.35;
  --lh-body:   1.55;
  --ls-tight:  -0.03em;
  --ls-eyebrow: 0.18em;
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;           /* Inter is served 400-600; heavier asks fall back to 600 */

  /* ---- motion ---- */
  --dur-fast:   150ms;
  --dur-base:   220ms;
  --dur-slow:   360ms;
  --dur-page:   280ms;          /* cross-document view transition */
  --dur-press:  80ms;
  --dur-sheen:  600ms;
  --dur-orbit:  5.6s;
  --dur-sky-a:  52s;
  --dur-sky-b:  64s;
  --dur-sky-1:  56s;            /* the sky's lines move as one layer (WEVA-W-261) */
  --ease-out:   cubic-bezier(.2, .8, .2, 1);
  --ease-in:    cubic-bezier(.4, 0, 1, 1);
  --rise:       8px;            /* content rises this far on page change */
  --lift:       3px;            /* cards lift this far on hover */
  --press:      .97;            /* button press scale */

  /* ---- layers ---- */
  --z-sky:    0;
  --z-top:    20;
  --z-scrim:  55;
  --z-drawer: 60;
  --z-menu:   80;
  --z-toast:  90;
}

:root[data-theme="light"] {
  color-scheme: light;
  /* WEVA-W-316 R1 (replacing W-299 criterion 1a): the pale fill (flat: a darker end
     would take the label under 4.5:1), its hover fill, the label on both (--c-on-accent,
     the brand's light on-accent), and a 2 px edge in the edge tone, 3:1+ on every light
     ground. A member's own light accent sets these from their stylesheet. */
  --c-accent-edge:  var(--brand-accent-edge);
  --c-accent-decor: var(--brand-accent-decor);
  --c-fill-a:       var(--brand-accent-fill);
  --c-fill-b:       var(--brand-accent-fill);
  --c-fill-hover:   var(--brand-accent-hover);
  --c-fill-hover-bg: var(--c-fill-hover);
  --c-fill-edge:    var(--c-accent-edge);
  --c-fill-edge-width: 2px;
  --c-fill-edge-inset: 1px;
  --c-switch-on:    var(--c-fill-a);
  --btn-edge-width:   2px;
  --btn-line:         var(--c-accent-edge);
  --btn-line-hover:   var(--c-accent-edge);
  --btn-hover-filter: none;
  /* WEVA-W-316 round 3, criterion 14 (Mat's L1, option b): the page's one main action
     (shell.css, [data-main-action]) on the accent's fill B, a mid-light fill of the same
     hue, with the page's ink as its label (8:1 or more on fill B and its hover for the five
     accents, 7.8:1 for derived ones; make_brand_assets.py holds 4.5:1) and the same 2 px edge. Weva amber's from the light set's
     brand rows; a member's own light accent sets --c-fill-main / --c-fill-main-hover
     from their stylesheet. Light mode only: dark mode has no such tokens and no such rule. */
  --c-fill-main:       var(--brand-accent-fill-main);
  --c-fill-main-hover: var(--brand-accent-hover-main);
  --c-on-fill-main:    var(--c-text);
  /* criterion 5: the tint of hover and active rows is the edge at 10 %; links, accent
     text and the active item take the text tone (--c-accent, 4.5:1+ on the tint too);
     the focus ring is 2 px of the edge tone at a 2 px offset. */
  --c-accent-wash:   color-mix(in srgb, var(--c-accent-edge) 10%, transparent);
  --c-accent-wash-2: color-mix(in srgb, var(--c-accent-edge) 10%, transparent);
  --c-line-accent:   var(--c-accent-edge);
  --focus-outline:   2px solid var(--c-accent-edge);
  --focus-ring:      0 0 0 2px var(--c-surface), 0 0 0 4px var(--c-accent-edge);
  --c-nav-current:      var(--c-accent);
  --c-nav-icon-current: var(--c-accent-edge);
  /* criterion 6: the tiles' icons in the decorative tone (no contrast floor; their
     shading steps mixed toward the edge tone and the surface) */
  --icon-ribbon-light: var(--c-accent-decor);
  --icon-ribbon-mid:   color-mix(in srgb, var(--c-accent-decor) 70%, var(--c-accent-edge));
  --icon-ribbon-deep:  color-mix(in srgb, var(--c-accent-decor) 40%, var(--c-accent-edge));
  --icon-fold-light:   color-mix(in srgb, var(--c-accent-decor) 80%, var(--p-surface));
  --icon-fold-deep:    color-mix(in srgb, var(--c-accent-decor) 40%, var(--c-accent-edge));
  --c-line:        color-mix(in srgb, var(--p-line) 14%, transparent);
  --c-line-strong:  color-mix(in srgb, var(--p-line) 20%, transparent);
  --c-line-hover:   color-mix(in srgb, var(--p-line) 34%, transparent);
  --c-col-top:      color-mix(in srgb, color-mix(in srgb, var(--c-bg), var(--p-shine) 60%) 80%, transparent);
  --c-col-bottom:   color-mix(in srgb, color-mix(in srgb, var(--c-bg), var(--p-shine) 60%) 80%, transparent);
  --c-top-veil:     color-mix(in srgb, var(--c-bg) 90%, transparent);
  --c-panel-from:   color-mix(in srgb, var(--p-surface) 90%, transparent);
  --c-panel-to:     color-mix(in srgb, var(--p-surface) 86%, transparent);
  --c-panel-accent: color-mix(in srgb, var(--c-accent) 11%, var(--p-surface));
  --c-hero-from:    var(--p-surface);
  --c-hero-to:      color-mix(in srgb, var(--c-bg), var(--c-accent) 6%);
  --c-hero-glow:    color-mix(in srgb, var(--c-accent) 20%, transparent);
  --c-field:        var(--p-surface);
  --c-control:      var(--p-surface);
  --c-menu:         var(--p-surface);
  --c-scrim:        color-mix(in srgb, var(--p-text) 28%, transparent);
  --c-highlight:    color-mix(in srgb, var(--p-shine) 90%, transparent);
  --c-light:        color-mix(in srgb, var(--c-accent) 10%, transparent);
  --c-orbit-mid:    color-mix(in srgb, var(--c-accent) 50%, transparent);
  --c-orbit-head:   var(--c-accent);
  --c-sky-a:        color-mix(in srgb, var(--p-sky-a) 10%, transparent);
  --c-sky-b:        color-mix(in srgb, var(--p-sky-b) 8%, transparent);
  --sky-line-opacity: .55;
  --c-ground-glow-a: color-mix(in srgb, var(--c-accent) 12%, transparent);
  --c-ground-glow-b: color-mix(in srgb, var(--p-sky-b) 9%, transparent);

  /* WEVA-W-262 criterion 1: the light set's own shadow (--brand-shadow, already
     translucent; Paper's at 70 % is about the 7 % of the text colour this
     used before) */
  --shadow-panel:      0 10px 26px color-mix(in srgb, var(--brand-shadow) 70%, transparent),
                       inset 0 1px 0 var(--c-highlight);
  --shadow-card:       0 10px 26px color-mix(in srgb, var(--brand-shadow) 70%, transparent),
                       inset 0 1px 0 var(--c-highlight);
  --shadow-card-hover: 0 16px 34px var(--brand-shadow),
                       0 0 20px color-mix(in srgb, var(--c-accent) 12%, transparent);
  --shadow-column:     0 0 32px color-mix(in srgb, var(--brand-shadow) 60%, transparent);
  --shadow-menu:       0 16px 38px var(--brand-shadow);
  --shadow-dialog:     0 22px 54px var(--brand-shadow), 0 6px 16px color-mix(in srgb, var(--brand-shadow) 60%, transparent);
}

/* =============================================== 4. LEGACY ALIASES ======
 * Only inside the member shell (`<html class="shell-v2">`, set by
 * _layout.html for a signed-in page). The selectors carry one class more
 * than the older files' own `:root` / `:root[data-theme="light"]` blocks,
 * so they win whichever file loads last. Signed-out pages keep W-197's rail
 * and its palette untouched. */
:root.shell-v2,
:root.shell-v2[data-theme="light"] {
  --bg:            var(--c-bg);
  --surface:       var(--c-surface);
  --surface-2:     var(--c-surface-2);
  --border:        var(--c-line-strong);
  --text:          var(--c-text);
  --text2:         var(--c-text-2);
  /* WEVA-W-235 round 3 (criterion 13): the older files colour headings with
     --primary and put a label (--on-accent) on --accent, so these take the
     roles brand_profile.md gives text and labels: headings in the brand's
     text colour (Bright Purple was 3.21:1 in light, "never body text"), and
     the label on accent-fill (Lilac White on Purple is 3.65:1 in dark;
     on Deep Purple 4.91:1, White on Purple 5.72:1 in light). */
  --primary:       var(--brand-text);
  --accent:        var(--brand-accent-fill);
  --accent-hover:  var(--c-accent-2);
  --on-accent:     var(--brand-on-accent);
  --ok:            var(--c-ok);
  --err:           var(--c-err);
  --btn-bg:        var(--c-control);
  --btn-bg-hover:  var(--c-surface-2);
  --btn-fg:        var(--c-text);
  --field-bg:      var(--c-field);
  --glass-bg:      var(--c-panel-from);
  --glass-bg-strong: var(--c-panel-to);
  --glass-border:  var(--c-line);
  --glass-shine:   var(--c-highlight);
  --radius:        var(--radius-card);
  --radius-s:      var(--radius-control);
  --radius-lg:     var(--radius-panel);
  --radius-md:     var(--radius-card);
  --radius-sm:     var(--radius-control);
  --gap-lg:        var(--card-gap);
}

/* ============================================ the one global rule =======
 * W-222 criterion 5: the `hidden` attribute always hides. Weft (W-194) and
 * the W-031 Builder each found a class rule (`.field-form { display:flex }`
 * and similar) winning over `hidden`; `!important` here wins over any of
 * them, on every page. */
[hidden] { display: none !important; }
