/* atoms/styles/base: the design base every section is drawn on (design/html-sections/BRAND.md is the contract).

   1. Tokens: every token with its default on :root. A brand's token block (render/layout) comes after this sheet and replaces them.
   2. Grounds: the colour roles (--g-*) re-valued on each ground: page, alt, inverse, brand, photo. Each ground is a [data-ground]
      value and the class atoms/section prints today (section-bg-surface, -dark, -accent; a cover photo).
   3. The old names the atoms' CSS reads, aliased onto the tokens, on every ground (a var() resolves where it is declared).
   4. The page, type roles, links and focus.
   5. Buttons, cards, photos, icons, rules.
   6. The section frame and the layout classes an HTML look may use (b-*): stack, row, head, grid, split, measure, reveal.

   Switches on <html>, for what a value can't say: data-eyebrow (label|rule: tracked small capitals, with a short rule where the direction draws rules), data-display-case (none|upper),
   data-btn-case (none|upper), data-cards (outlined|raised|filled), data-btn-fill (solid|soft|outline|ink), data-btn-shadow (hard), data-icon-ink (brand|ink),
   and the direction's signature, data-sig-* (BRAND-directions.md "Signatures"): its tokens below, its devices (b-sig-rule, b-frame, b-motif) in 5;
   and the motifs (7): data-pattern-place (page|bands|hero), data-motion (still|calm|crafted|lively), and the corner slot .b-corner[data-corner].
   Custom properties starting --_ are this sheet's own inputs, not tokens: a section never reads them. */

/* ---------------------------------------------------------------- 1. tokens */

:root {
  /* what the default grounds are derived from (a brand's block writes every ground's roles as plain values instead) */
  --_page: #FAFAF7;
  --_ink: #16171B;

  /* colour: fills (the same on every ground) */
  --c-brand: #24539E;
  --c-accent-ground: var(--c-brand);      /* an accent-ground section's colour (the layout: a tint on soft bands, deep on a dark page), #1404 */
  --c-on-brand: #FFFFFF;
  --c-second: #B5532E;
  --c-on-second: #FFFFFF;

  /* type */
  --font-display: 'Manrope', 'Avenir Next', Avenir, 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --fs-display: clamp(2.75rem, 1.6rem + 4.2vw, 5rem);
  --fs-h2: clamp(2rem, 1.4rem + 2vw, 3rem);
  --fs-h3: clamp(1.25rem, 1.25rem + (100vw - 22.5rem) * 0.00238, 1.375rem);
  --fs-lead: clamp(1.125rem, 1rem + .4vw, 1.3125rem);
  --fs-body: 1.0625rem;
  --fs-small: .875rem;
  --fw-display: 600;
  --track-display: -0.035em;
  --lh-display: 1.04;
  --head-style: normal;      /* a section heading's treatment, set per direction by render/layout (BRAND-directions.md 2.1) */
  --head-case: none;
  --head-weight: 600;
  --head-tracking: 0;
  --head-rule: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  --motif-band: none;        /* the direction's band of diamonds (motif pattern), none after the page's first band (5, "signature devices") */

  /* space */
  --space-section: clamp(4rem, 2.5rem + 5vw, 7rem);
  --space-stack: 1.5rem;
  --section-pad: calc(var(--space-section) * var(--sig-air));   /* a section's top and bottom padding, driven by the density (BRAND.md 3) */
  --space-gap: 1.5rem;
  --space-card: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  --container: 1320px;
  --measure: 65ch;

  /* radius */
  --r-sm: .375rem;
  --r-md: .625rem;
  --r-lg: 1rem;

  /* elevation (--shadow-ink: the ink taken toward black, so a shadow on cream is warm, not grey) */
  --shadow-ink: color-mix(in srgb, var(--_ink) 60%, #000);
  --shadow-card: 0 1px 2px color-mix(in srgb, var(--shadow-ink) 6%, transparent), 0 8px 24px color-mix(in srgb, var(--shadow-ink) 8%, transparent);
  --shadow-pop: 0 2px 6px color-mix(in srgb, var(--shadow-ink) 10%, transparent), 0 18px 48px color-mix(in srgb, var(--shadow-ink) 14%, transparent);

  /* lines and cards (--card-edge and --card-bg are set per ground below, from data-cards) */
  --line-w: 1px;

  /* photos */
  --photo-filter: none;       /* the direction's grade: every photo in main takes it (5), so a page's photos share one look */
  --photo-landscape: 16 / 10; /* the direction's two crops (render/layout): under a direction every landscape (16:9, 4:3) photo takes the first */
  --photo-portrait: 4 / 5;
  --photo-radius: var(--r-lg);
  --photo-mat: 0px;
  --scrim: .65;               /* the scrim's opacity under words on a photo */
  --scrim-color: #000;        /* and its colour: the photo ground's words are always light, so this stays a deep colour */

  /* buttons */
  --btn-radius: var(--r-sm);
  --btn-pad-y: .8125rem;
  --btn-pad-x: 1.5rem;
  --btn-weight: 600;
  --btn-track: 0;

  /* icons (--icon-ink is set per ground below, from data-icon-ink) */
  --icon-stroke: 2;
  --icon-chip: color-mix(in srgb, var(--c-brand) 12%, transparent);
  --icon-chip-radius: 50%;

  /* motion */
  --dur: 200ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --reveal: 12px;

  /* a form field's edge (WCAG 1.4.11, 3:1), kept as it is */
  --field-edge: color-mix(in srgb, var(--_ink) 45%, var(--_page));

  /* the signature's tokens (data-sig-density, data-sig-rule): space multiplier and the direction's rule (currentColor resolves where it is used) */
  --sig-air: 1;
  --sig-rule: var(--line-w) solid color-mix(in srgb, currentColor 28%, transparent);

  /* the base's own measures: the side gutter (16px on a phone) and the section sizes */
  --_gutter: clamp(1rem, .4rem + 2.6vw, 2.5rem);
  /* the page column's edge, from the screen's: the gutter, or the margin beside the container on a wide screen; a full-bleed section pads its words by it so
     they line up with every other section's */
  --page-edge: max(var(--_gutter), (100vw - var(--container)) / 2);
}
@media (min-width: 75rem) { :root { --fs-body: 1.125rem; } }
:root[data-sig-density="airy"] { --sig-air: 1.2; }   /* capped: with the airy spacing step (1.1) the largest section gap is ~170px at 1280 */
:root[data-sig-density="tight"] { --sig-air: .6; }
:root[data-sig-rule="double"] { --sig-rule: calc(var(--line-w) * 4) double color-mix(in srgb, currentColor 70%, transparent); }
:root[data-sig-rule="heavy"] { --sig-rule: calc(var(--line-w) * 4) solid currentColor; }
:root[data-sig-rule="none"] { --sig-rule: 0 solid transparent; }
@media (prefers-reduced-motion: reduce) { :root { --dur: 0ms; --ease: linear; --reveal: 0px; } }

/* ---------------------------------------------------------------- 2. grounds */

/* page: the page colour (also a nested section put back on the page, and a hero's card over its photo) */
:root, [data-ground="page"], .hb-card {
  --g-bg: var(--_page);
  --g-ink: var(--_ink);
  --g-quiet: color-mix(in srgb, var(--_ink) 70%, var(--_page));
  --g-brand-ink: color-mix(in srgb, var(--c-brand) 88%, var(--_ink));
  --g-second-ink: color-mix(in srgb, var(--c-second) 80%, var(--_ink));
  --g-line: color-mix(in srgb, var(--_ink) 14%, var(--_page));
  --g-surface: color-mix(in srgb, #FFFFFF 72%, var(--_page));
  --g-danger: #B42318;
  --g-pattern: var(--g-pattern-light, none);
  --g-mark: var(--g-brand-ink);      /* the wordmark's coloured last character (atoms/brand): render/layout writes the brand where it stands at 3:1 on the ground, else the brand as words */
}
/* alt: the page leaned toward its ink */
[data-ground="alt"], .section-bg-surface {
  --g-bg: color-mix(in srgb, var(--_ink) 4%, var(--_page));
  --g-ink: var(--_ink);
  --g-quiet: color-mix(in srgb, var(--_ink) 72%, var(--_page));
  --g-brand-ink: color-mix(in srgb, var(--c-brand) 85%, var(--_ink));
  --g-second-ink: color-mix(in srgb, var(--c-second) 78%, var(--_ink));
  --g-line: color-mix(in srgb, var(--_ink) 17%, var(--_page));
  --g-surface: color-mix(in srgb, #FFFFFF 72%, var(--_page));
  --g-danger: #B42318;
  --g-pattern: var(--g-pattern-light, none);
  --g-mark: var(--g-brand-ink);
}
/* inverse: the ink as the ground, the page as the words (it flips: on a dark direction it is light).
   dark: always a deep dark ground; render/layout writes it for a dark direction as the page deepened toward black, and for a light one it is the inverse. */
[data-ground="inverse"], [data-ground="dark"], .section-bg-dark {
  --g-bg: var(--_ink);
  --g-ink: var(--_page);
  --g-quiet: color-mix(in srgb, var(--_page) 68%, var(--_ink));
  --g-brand-ink: color-mix(in srgb, var(--c-brand) 45%, var(--_page));
  --g-second-ink: color-mix(in srgb, var(--c-second) 55%, var(--_page));
  --g-line: color-mix(in srgb, var(--_page) 16%, var(--_ink));
  --g-surface: color-mix(in srgb, var(--_page) 7%, var(--_ink));
  --g-danger: #FF8A7A;
  --g-pattern: var(--g-pattern-dark, none);
  --g-mark: var(--g-brand-ink);
}
/* brand: the brand fill */
[data-ground="brand"], .section-bg-accent {
  --g-bg: var(--c-brand);
  --g-ink: var(--c-on-brand);
  --g-quiet: color-mix(in srgb, var(--c-on-brand) 86%, var(--c-brand));
  --g-brand-ink: var(--c-on-brand);
  --g-second-ink: var(--c-on-brand);
  --g-line: color-mix(in srgb, var(--c-on-brand) 32%, var(--c-brand));
  --g-surface: color-mix(in srgb, var(--c-on-brand) 10%, var(--c-brand));
  --g-danger: var(--c-on-brand);
  --g-pattern: var(--g-pattern-dark, none);
  --g-mark: var(--c-on-brand);       /* on the brand ground the whole mark is the ground's words */
}
/* photo: white words over a scrim of at least --scrim; the same for every brand (the scrim is the guard, not the photo) */
[data-ground="photo"], .sx-section--cover, .hero--bg {
  --g-bg: #141414;
  --g-ink: #FFFFFF;
  --g-quiet: rgb(255 255 255 / .86);
  --g-brand-ink: #FFFFFF;
  --g-second-ink: #FFFFFF;
  --g-line: rgb(255 255 255 / .32);
  --g-surface: rgb(20 20 20 / .55);
  --g-danger: #FFB4A8;
  --g-pattern: none;
  --g-mark: #FFFFFF;
}
:is([data-ground], .section-bg-surface, .section-bg-dark, .section-bg-accent, .hb-card):not(:root) {
  background-color: var(--g-bg);
  color: var(--g-ink);
}
:is([data-ground="photo"], .sx-section--cover, .hero--bg) { background-color: var(--g-bg); color: var(--g-ink); }
.sx-section--cover::before { background: color-mix(in srgb, var(--scrim-color) calc(max(var(--scrim), .55) * 100%), transparent); }

/* the older .section-bg-dark rule (site sheet) names the page-on-ink words; the dark ground's own roles stand on every direction */
:root :is([data-ground="dark"], .section-bg-dark) { --muted: var(--g-quiet); --danger: var(--g-danger); }

/* the tokens that read a ground's roles, declared on every ground so each resolves there */
:root, [data-ground], .section-bg-surface, .section-bg-dark, .section-bg-accent, .sx-section--cover, .hero--bg, .hb-card {
  --card-bg: var(--g-surface);
  --card-edge: var(--line-w) solid var(--g-line);
  --_card-line: var(--g-line);
  --icon-ink: var(--g-brand-ink);
}
:root[data-cards="filled"], [data-cards="filled"] :is([data-ground], .section-bg-surface, .section-bg-dark, .section-bg-accent, .sx-section--cover, .hero--bg, .hb-card) {
  --card-bg: color-mix(in srgb, var(--g-ink) 5%, var(--g-bg));
  --card-edge: 1px solid transparent;
  --_card-line: transparent;
}
:root[data-cards="raised"], [data-cards="raised"] :is([data-ground], .section-bg-surface, .section-bg-dark, .section-bg-accent, .sx-section--cover, .hero--bg, .hb-card) {
  --card-edge: 1px solid transparent;
  --_card-line: transparent;
}
/* the direction's own section card (sections that draw cards on a ground): fill, hairline and lift by data-cards; filled is the accent tinted into the ground, never a shared grey */
:root, [data-ground], .section-bg-surface, .section-bg-dark, .section-bg-accent, .sx-section--cover, .hero--bg, .hb-card {
  --card-fill: color-mix(in srgb, var(--c-brand) 10%, var(--g-bg));
  --card-hair: transparent;
  --card-lift: none;
}
:root[data-cards="outlined"], [data-cards="outlined"] :is([data-ground], .section-bg-surface, .section-bg-dark, .section-bg-accent, .sx-section--cover, .hero--bg, .hb-card) { --card-fill: transparent; --card-hair: var(--g-ink); }
:root[data-cards="raised"], [data-cards="raised"] :is([data-ground], .section-bg-surface, .section-bg-dark, .section-bg-accent, .sx-section--cover, .hero--bg, .hb-card) { --card-fill: var(--g-surface); --card-lift: var(--shadow-card); }
/* a direction whose outlined cards are hairlines (shopfront): the ground's own line, not its words */
:root[data-card-hair="line"], [data-card-hair="line"] :is([data-ground], .section-bg-surface, .section-bg-dark, .section-bg-accent, .sx-section--cover, .hero--bg, .hb-card) { --card-hair: var(--g-line); }
:root[data-icon-ink="ink"], [data-icon-ink="ink"] :is([data-ground], .section-bg-surface, .section-bg-dark, .section-bg-accent, .sx-section--cover, .hero--bg, .hb-card) {
  --icon-ink: var(--g-ink);
}

/* The atoms' fixed colours: a colour that is the same on every ground and every brand (black and white, a status, a build page's own greys). They are the
   only place the atoms' sheets get a literal colour from (atoms_css_lint), and sections do not read them (the token list ends before this section). */
:root {
  --white: #fff;
  --black: #000;
  --white-rgb: 255 255 255;
  --black-rgb: 0 0 0;
  --ink-soft: #5C5C66;
  --status-good-bg: #E6F4EA;
  --status-good-ink: #1E6B35;
  --status-warn-bg: #FFF4DB;
  --status-warn-ink: #7A5200;
  --status-bad-bg: #FDECEA;
  --status-bad-ink: #B42318;
  --open-dot: #1a7f3c;
  --open-dot-on-dark: #5fd388;
  --build-ground: #f7f7f5;
  --build-ink-soft: #666;
  --build-dot: #ddd;
  --build-working: #f0b429;
  --build-done: #38a169;
  --build-failed: #e53e3e;
}

/* ---------------------------------------------------------------- 3. the old names, on the tokens */

:root, [data-ground], .section-bg-surface, .section-bg-dark, .section-bg-accent, .sx-section--cover, .hero--bg, .hb-card {
  --bg: var(--g-bg);
  --fg: var(--g-ink);
  --muted: var(--g-quiet);
  --muted-on-page: var(--g-quiet);
  --accent-ink: var(--g-brand-ink);
  --secondary-ink: var(--g-second-ink);
  --line: var(--g-line);
  --card: var(--g-surface);
  --danger: var(--g-danger);
  --sx-body-color: var(--g-ink);
  --sx-border-color: var(--g-line);
}
:root {
  --accent: var(--c-brand);
  --on-accent: var(--c-on-brand);
  --secondary: var(--c-second);
  --on-secondary: var(--c-on-second);
  --radius-sm: var(--r-sm);
  --radius: var(--r-md);
  --radius-lg: var(--r-lg);
  --card-shadow: var(--shadow-card);
  --section-y: var(--section-pad);
  --section-y-lg: calc(var(--section-pad) * 1.15);
  --stack: var(--space-stack);
  --grid-gap: var(--space-gap);
  --card-pad: var(--space-card);
  --heading-font: var(--font-display);
  --font-heading: var(--font-display);
  --font-family: var(--font-body);
  --body-font: var(--font-body);
  --focus-ring: 0 0 0 2px var(--g-brand-ink);
  --sx-body-font-family: var(--font-body);
  --sx-border-radius-sm: var(--r-sm);
  --sx-border-radius: var(--r-md);
  --sx-border-radius-lg: var(--r-lg);
  --sx-box-shadow-sm: var(--shadow-card);
  --sx-box-shadow: var(--shadow-card);
  --sx-box-shadow-lg: var(--shadow-pop);
}

/* ---------------------------------------------------------------- 4. the page and type */

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--g-ink);
  background: var(--g-bg);
  font-kerning: normal;
}
/* Light words on a dark ground are drawn a little lighter on a Mac (grayscale smoothing), so they don't look heavy or bleed; dark words on a light
   ground keep the system's own smoothing, which a thin weight needs to stay crisp. (render/layout does the same for a whole dark page.) */
:is([data-ground="inverse"], [data-ground="dark"], .section-bg-dark, [data-ground="photo"], .sx-section--cover, .hero--bg,
    .sx-card--dark, .sx-cell--dark, .sx-bar--dark) {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: color-mix(in srgb, var(--c-brand) 22%, transparent); color: inherit; }

/* the roles (atoms/text prints sx-text--<role>) */
:where(h1, h2, h3, h4), .sx-text--display, .sx-text--heading, .sx-text--subheading, .sx-text--title {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  color: inherit;
  text-wrap: balance;
  hyphens: auto;
  hyphenate-limit-chars: 10 4 4;
  overflow-wrap: break-word;
}
.sx-text--display {
  font-size: var(--t-size-display, var(--fs-display));      /* a look can set --t-size/-tracking/-leading-display on its own element */
  line-height: var(--t-leading-display, var(--lh-display));
  letter-spacing: var(--t-tracking-display, var(--track-display));
  margin: 0;
}
/* a phrase marked in a headline (*italic*, **bold**): a section sets --t-em-colour and --t-em-style on its wrapper (the accent phrase) */
:where(.sx-text--display, .sx-text--heading) :where(em, strong) { color: var(--t-em-colour, inherit); }
:where(.sx-text--display, .sx-text--heading) em { font-style: var(--t-em-style, italic); }
.sx-text--heading {
  font-size: var(--fs-h2);
  line-height: calc(var(--lh-display) + .06);
  letter-spacing: calc(var(--track-display) * .8);
  margin: 0;
  max-width: 24ch;
}
.sx-text--center.sx-text--heading, .sx-text-center .sx-text--heading { margin-inline: auto; }
.sx-text--subheading, .sx-text--title {
  font-size: var(--fs-h3);
  line-height: 1.25;
  letter-spacing: calc(var(--track-display) * .4);
  margin: 0;
}
.sx-text--lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--g-quiet);
  max-width: 52ch;
  margin: 0;
  text-wrap: pretty;
}
.sx-text--body { max-width: var(--measure); text-wrap: pretty; }
:is(.sx-text--detail, .sx-text--caption, .sx-text--meta, .sx-text--note) { font-size: var(--fs-small); line-height: 1.5; color: var(--g-quiet); }
.sx-text--label { font-size: var(--fs-small); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
:root[data-display-case="upper"] :is(.sx-text--display, .sx-text--heading, .sx-text--subheading, .sx-text--title) { text-transform: uppercase; hyphens: manual; }
:root[data-display-case="upper"] :is(.sx-text--heading) { max-width: 20ch; }
/* a character's width in em of a headline's longest word, which caps its size so the word never breaks (atoms/text --t-word): lower case .6 (the atoms' default), capitals .74,
   spaced capitals .84. A direction that sets any head in capitals takes them for every headline, as a section may give its display line the head's case */
:root[data-display-case="upper"], :root[data-sig-heads="condensed"] { --fit-display: .74; --fit-heading: .74; }
:root[data-sig-heads="smallcaps"] { --fit-display: .84; --fit-heading: .84; }
/* one heading voice per page, upright: italic is the accent phrase's alone (*emphasis*, above); every section head (and the display line on a cover band or a tree-look photo hero) takes the direction's head tokens (render/layout HEADS,
   which follow its heads switch) unless its section sets its own; a site with no direction has no switch, so the atoms' defaults stand */
:root[data-sig-heads="accent"], :root[data-sig-heads="smallcaps"], :root[data-sig-heads="condensed"], :root[data-sig-heads="upright"] { --t-style-heading: var(--head-style); --t-case-heading: var(--head-case); --t-weight-heading: var(--head-weight); }
:root[data-sig-heads="smallcaps"], :root[data-sig-heads="condensed"] { --t-tracking-heading: var(--head-tracking); }
:root[data-sig-heads="smallcaps"] .sx-section--cover, :root[data-sig-heads="condensed"] .sx-section--cover { --t-tracking-display: var(--head-tracking); }
:root[data-sig-heads="accent"] :is(.sx-section--cover, .hero--bg), :root[data-sig-heads="smallcaps"] :is(.sx-section--cover, .hero--bg), :root[data-sig-heads="condensed"] :is(.sx-section--cover, .hero--bg), :root[data-sig-heads="upright"] :is(.sx-section--cover, .hero--bg)
  { --t-style-display: var(--head-style); --t-case-display: var(--head-case); --t-weight-display: var(--head-weight); }

/* the eyebrow: tracked small capitals in every direction; label (the default) or rule (a short rule before it) */
.sx-text--eyebrow {
  font-family: var(--font-body);
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--g-brand-ink);
  margin: 0;
}
:root[data-eyebrow="rule"] .sx-text--eyebrow {
  display: flex;
  align-items: center;
  gap: .875rem;
  letter-spacing: var(--t-tracking-eyebrow, var(--t-tracking, .08em));   /* a section's hook first, the direction's value after */
  font-weight: var(--t-weight-eyebrow, var(--t-weight, 500));
  text-transform: var(--t-case-eyebrow, var(--t-case, uppercase));
  font-style: var(--t-style-eyebrow, var(--t-style, inherit));
  color: var(--t-colour-eyebrow, var(--t-colour, inherit));   /* the words' own colour (light on a photo), or a section's */
}
:root[data-eyebrow="rule"] .sx-text--eyebrow::before { content: ""; flex: 0 0 1.5rem; border-top: max(1px, var(--line-w)) solid currentColor; opacity: .55; }
:root[data-eyebrow="rule"] :is(.sx-text--center, .sx-text-center) .sx-text--eyebrow,
:root[data-eyebrow="rule"] .sx-text--eyebrow.sx-text--center { justify-content: center; }

/* links in words, and focus everywhere */
:where(a):not([class]) {
  color: var(--g-brand-ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: text-decoration-thickness var(--dur) var(--ease);
}
:where(a):not([class]):hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--g-brand-ink); outline-offset: 2px; }

/* ---------------------------------------------------------------- 5. buttons, cards, photos, icons, rules */

/* buttons (atoms/button prints Bootstrap's .sx-btn): shape, size and case from the tokens; fill from data-btn-fill and the ground */
.sx-btn {
  --sx-btn-padding-y: var(--btn-pad-y);
  --sx-btn-padding-x: var(--btn-pad-x);
  --sx-btn-font-family: var(--font-body);
  --sx-btn-font-size: 1rem;
  --sx-btn-font-weight: var(--btn-weight);
  --sx-btn-line-height: 1.25;
  --sx-btn-border-width: max(1.5px, var(--line-w));
  --sx-btn-border-radius: var(--btn-radius);
  --sx-btn-focus-box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 2.75rem;
  letter-spacing: 0;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.sx-btn-lg { --sx-btn-font-size: 1.0625rem; }
.sx-btn-sm { --sx-btn-padding-y: .5rem; --sx-btn-padding-x: 1.125rem; --sx-btn-font-size: .9375rem; }
:root[data-btn-case="upper"] .sx-btn:not(.sx-btn-link) { text-transform: uppercase; letter-spacing: var(--btn-track); font-size: var(--button-size, .875em); }
:root[data-btn-case="upper"] .sx-btn-lg:not(.sx-btn-link) { --sx-btn-font-size: 1rem; }
.sx-btn:focus-visible { outline: 2px solid var(--g-brand-ink); outline-offset: 2px; box-shadow: none; }
@media (prefers-reduced-motion: no-preference) { .sx-btn:not(.sx-btn-link):hover { transform: translateY(-1px); } .sx-btn:active { transform: none; } }
/* hard (roastery): a printed offset shadow in the ground's words, so the button stands off any ground, dark or light */
:root[data-btn-shadow="hard"] .sx-btn:not(.sx-btn-link) { box-shadow: 4px 4px 0 var(--g-ink); }
:root[data-btn-shadow="hard"] .sx-btn:not(.sx-btn-link):active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--g-ink); }

/* primary, solid (the default fill) */
.sx-btn-primary {
  --sx-btn-color: var(--c-on-brand);
  --sx-btn-bg: var(--c-brand);
  --sx-btn-border-color: var(--c-brand);
  --sx-btn-hover-color: var(--c-on-brand);
  --sx-btn-hover-bg: color-mix(in srgb, var(--c-brand) 88%, #000);
  --sx-btn-hover-border-color: color-mix(in srgb, var(--c-brand) 88%, #000);
  --sx-btn-active-color: var(--c-on-brand);
  --sx-btn-active-bg: color-mix(in srgb, var(--c-brand) 82%, #000);
  --sx-btn-active-border-color: color-mix(in srgb, var(--c-brand) 82%, #000);
}
:root[data-btn-fill="soft"] .sx-btn-primary {
  --sx-btn-color: var(--g-brand-ink);
  --sx-btn-bg: color-mix(in srgb, var(--c-brand) 13%, transparent);
  --sx-btn-border-color: transparent;
  --sx-btn-hover-color: var(--c-on-brand);
  --sx-btn-hover-bg: var(--c-brand);
  --sx-btn-hover-border-color: var(--c-brand);
  --sx-btn-active-color: var(--c-on-brand);
  --sx-btn-active-bg: var(--c-brand);
}
:root[data-btn-fill="outline"] .sx-btn-primary {
  --sx-btn-color: var(--g-brand-ink);
  --sx-btn-bg: transparent;
  --sx-btn-border-color: var(--g-brand-ink);
  --sx-btn-hover-color: var(--g-bg);
  --sx-btn-hover-bg: var(--g-brand-ink);
  --sx-btn-hover-border-color: var(--g-brand-ink);
  --sx-btn-active-color: var(--g-bg);
  --sx-btn-active-bg: var(--g-brand-ink);
}
/* secondary: a quiet outline in the words' colour */
.sx-btn-outline-primary, .sx-btn-secondary {
  --sx-btn-color: var(--g-ink);
  --sx-btn-bg: transparent;
  --sx-btn-border-color: color-mix(in srgb, var(--g-ink) 30%, var(--g-line));
  --sx-btn-hover-color: var(--g-bg);
  --sx-btn-hover-bg: var(--g-ink);
  --sx-btn-hover-border-color: var(--g-ink);
  --sx-btn-active-color: var(--g-bg);
  --sx-btn-active-bg: var(--g-ink);
  --sx-btn-active-border-color: var(--g-ink);
}
.sx-btn-link {
  --sx-btn-color: var(--g-brand-ink);
  --sx-btn-hover-color: var(--g-brand-ink);
  --sx-btn-padding-x: 0;
  --sx-btn-bg: transparent; --sx-btn-border-color: transparent; --sx-btn-hover-bg: transparent; --sx-btn-hover-border-color: transparent; --sx-btn-active-bg: transparent; --sx-btn-active-border-color: transparent; /* a text link is never boxed, in any direction or ground */
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .25em;
}
/* ink (a direction's buttonFill "ink", BRAND-tokens.md 1.8): the primary is the ground's words as a fill with the ground as its letters, so it flips with the ground (dark on a light page,
   light on an inverse or dark one, white on a photo) and reads by construction (every ground's words read on it at 4.5:1); never a fixed hex. On the brand ground the rule below keeps the on-brand button */
:root[data-btn-fill="ink"] .sx-btn-primary {
  --sx-btn-color: var(--g-bg);
  --sx-btn-bg: var(--g-ink);
  --sx-btn-border-color: var(--g-ink);
  --sx-btn-hover-color: var(--g-bg);
  --sx-btn-hover-bg: color-mix(in srgb, var(--g-ink) 84%, var(--g-bg));
  --sx-btn-hover-border-color: color-mix(in srgb, var(--g-ink) 84%, var(--g-bg));
  --sx-btn-active-color: var(--g-bg);
  --sx-btn-active-bg: color-mix(in srgb, var(--g-ink) 90%, var(--g-bg));
  --sx-btn-active-border-color: color-mix(in srgb, var(--g-ink) 90%, var(--g-bg));
}
/* on the brand ground a brand fill would vanish: the button is drawn in the ground's words */
:root :is([data-ground="brand"], .section-bg-accent) .sx-btn-primary {
  --sx-btn-color: var(--c-brand);
  --sx-btn-bg: var(--c-on-brand);
  --sx-btn-border-color: var(--c-on-brand);
  --sx-btn-hover-color: var(--c-brand);
  --sx-btn-hover-bg: color-mix(in srgb, var(--c-on-brand) 88%, var(--c-brand));
  --sx-btn-hover-border-color: color-mix(in srgb, var(--c-on-brand) 88%, var(--c-brand));
  --sx-btn-active-color: var(--c-brand);
  --sx-btn-active-bg: color-mix(in srgb, var(--c-on-brand) 92%, var(--c-brand));      /* (pressed is nearer the ground's words than hovered, so the brand lettering keeps 4.5:1 on it) */
}
/* an ink-filled direction's secondary is the quiet outline in the ground's words, not the brand colour: one colour for words and buttons, the brand kept for grounds */
:root[data-btn-fill="ink"] .sx-btn-outline-primary {
  --sx-btn-color: var(--g-ink);
  --sx-btn-bg: transparent;
  --sx-btn-border-color: color-mix(in srgb, var(--g-ink) 30%, var(--g-line));
  --sx-btn-hover-color: var(--g-bg);
  --sx-btn-hover-bg: var(--g-ink);
  --sx-btn-hover-border-color: var(--g-ink);
  --sx-btn-active-color: var(--g-bg);
  --sx-btn-active-bg: var(--g-ink);
  --sx-btn-active-border-color: var(--g-ink);
}
/* an ink-filled direction keeps its ink button on the brand ground: the brand's words as the fill, the page's paper as the letters (layout's --c-ink-btn-word reads on that fill) */
:root[data-btn-fill="ink"] :is([data-ground="brand"], .section-bg-accent) .sx-btn-primary {
  --sx-btn-color: var(--c-ink-btn-word, var(--c-brand));
  --sx-btn-hover-color: var(--c-ink-btn-word, var(--c-brand));
  --sx-btn-active-color: var(--c-ink-btn-word, var(--c-brand));
}
/* on a dark, inverse or photo ground the primary is the brand when it stands off the ground (3:1) and its words read on it (4.5:1), else the brand moved
   toward white or black by the first step at which both hold. The ground says which (--g-btn, --g-btn-ink: render/layout, from libs/theme-colours buttonOn,
   a real contrast ratio against the ground's real colour; CSS cannot take one). Without them (a sheet with no brand tokens) the brand and its own words. */
:root:not([data-btn-fill="soft"]):not([data-btn-fill="outline"]):not([data-btn-fill="ink"]) :is([data-ground="inverse"], [data-ground="dark"], .section-bg-dark, [data-ground="photo"], .sx-section--cover, .hero--bg) .sx-btn-primary:not(.hb-card .sx-btn-primary) {
  --_btn: var(--g-btn, var(--c-brand));
  --_btn-ink: var(--g-btn-ink, var(--c-on-brand));
  --sx-btn-color: var(--_btn-ink);
  --sx-btn-bg: var(--_btn);
  --sx-btn-border-color: var(--_btn);
  --sx-btn-hover-color: var(--_btn-ink);
  --sx-btn-hover-bg: color-mix(in srgb, var(--_btn) 88%, #000);
  --sx-btn-hover-border-color: color-mix(in srgb, var(--_btn) 88%, #000);
  --sx-btn-active-color: var(--_btn-ink);
  --sx-btn-active-bg: var(--_btn);      /* (a chip that is on: darkening the fill would take its words under 4.5:1; pressed is the lift going, not a darker fill) */
  --sx-btn-active-border-color: var(--_btn);
}
:root :is([data-ground="photo"], .sx-section--cover, .hero--bg) .sx-btn-outline-primary { --sx-btn-border-color: rgb(255 255 255 / .7); --sx-btn-hover-color: #141414; --sx-btn-hover-bg: #FFFFFF; --sx-btn-hover-border-color: #FFFFFF; }

/* cards: the base's own (.b-card) and Bootstrap's, from --card-bg / --card-edge; raised and outlined cards carry --shadow-card */
.b-card {
  display: flex;
  flex-direction: column;
  gap: calc(var(--space-stack) * .5);
  background: var(--card-bg);
  border: var(--card-edge);
  border-radius: var(--r-md);
  padding: var(--space-card);
  color: var(--g-ink);
  box-shadow: var(--shadow-card);
  min-width: 0;
}
:root[data-cards="filled"] .b-card { box-shadow: none; }
.card {
  --sx-card-bg: var(--card-bg);
  --sx-card-border-color: var(--_card-line);
  --sx-card-border-width: var(--line-w);
  --sx-card-border-radius: var(--r-md);
  --sx-card-inner-border-radius: max(0px, calc(var(--r-md) - var(--line-w)));
  --sx-card-spacer-y: var(--space-card);
  --sx-card-spacer-x: var(--space-card);
  --sx-card-color: var(--g-ink);
}
/* a photo flush to a card's top edge takes the card's radius less its edge (nested radii) */
.b-card > .b-media:first-child { margin: calc(var(--space-card) * -1) calc(var(--space-card) * -1) 0; border-radius: max(0px, calc(var(--r-md) - var(--line-w))) max(0px, calc(var(--r-md) - var(--line-w))) 0 0; }
.b-card > .b-media:first-child img { border-radius: inherit; box-shadow: none; }
/* a card on a card's ground that stands out: the brand fill or the inverse */
.b-card--brand { background: var(--c-brand); color: var(--c-on-brand); border-color: transparent; }
.b-panel { background: var(--card-bg); border: var(--card-edge); border-radius: var(--r-lg); padding: calc(var(--space-card) * 1.5); }

/* photos: .b-media wraps an image (atoms/image); the frame comes from the tokens; a mat is drawn round the photo, so its outer
   corner is the photo's corner plus the mat (the nested-radius rule held the other way round) */
.b-media { position: relative; min-width: 0; border-radius: var(--photo-radius); padding: var(--photo-mat); }
.b-media img, .b-media picture { display: block; width: 100%; height: 100%; object-fit: cover; }
.b-media img {
  filter: var(--photo-filter);
  border-radius: var(--photo-radius);
  box-shadow: 0 0 0 var(--photo-mat) var(--g-surface), 0 0 0 calc(var(--photo-mat) + min(1px, var(--photo-mat) * 999)) var(--g-line);
}
.b-media--wide img { aspect-ratio: var(--photo-landscape); }
.b-media--square img { aspect-ratio: 1; }
.b-media--tall img { aspect-ratio: var(--photo-portrait); }
/* one grade and two crops per page: every photo in main (atoms/image), whatever section draws it; a logo is not a photo */
:where(main) .sx-image:not(.sx-image--logo) { filter: var(--photo-filter); }
:root[data-sig-heads] main :is(.sx-image--16-9, .sx-image--4-3) { aspect-ratio: var(--photo-landscape); }

/* icons: a chip behind an icon (atoms/icon), drawn in the brand's or the words' colour */
.b-chip {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: var(--icon-chip-radius);
  background: var(--icon-chip);
  color: var(--icon-ink);
}
.b-chip svg { width: 1.5rem; height: 1.5rem; stroke-width: var(--icon-stroke); }
/* a direction's icon weight (its `ic`, --icon-stroke) on every line icon, not only the chip's: a card's or a link's icon and a fact's; a site with no direction keeps the icons' own 1.75 */
:root[data-sig-heads] :is(.sx-icon, .sx-fact) > svg { stroke-width: var(--icon-stroke); }

/* rules */
.b-rule { border: 0; border-top: var(--line-w) solid var(--g-line); margin: 0; opacity: 1; width: 100%; }

/* signature devices (BRAND-directions.md "Signatures"): a section puts the class on its own element and the direction's switch draws it. One device a page:
   the rule divides sections (a section's own heads and lists take a plain hairline), and the menu-card frame is the menu's alone */
.b-sig-rule { border: 0; border-top: var(--sig-rule); margin: 0; width: 100%; opacity: 1; color: inherit; }
:root[data-sig-rule="none"] .b-sig-rule { display: none; }
:root[data-sig-rule="ornament"] .b-sig-rule { border: 0; height: .75rem; overflow: visible; text-align: center; line-height: .75rem; font-size: .75rem;
  background: linear-gradient(currentColor, currentColor) left center / calc(50% - 1rem) var(--line-w) no-repeat, linear-gradient(currentColor, currentColor) right center / calc(50% - 1rem) var(--line-w) no-repeat; }
:root[data-sig-rule="ornament"] .b-sig-rule::after { content: "\25C6"; }
:root[data-sig-frame="card"] .b-frame { background: var(--card-bg); border: var(--card-edge); border-radius: var(--r-lg); padding: calc(var(--space-card) * 1.5); }
:root[data-sig-frame="inset"] .b-frame { background: color-mix(in srgb, currentColor 5%, transparent); border-radius: var(--r-md); padding: calc(var(--space-card) * 1.5); }
:root[data-sig-frame="menu-card"] .b-frame:has(.sx-list--menu, .sx-list--menu-columns) { border: var(--line-w) solid currentColor; padding: calc(var(--space-card) * 2) calc(var(--space-card) * 1.5);
  box-shadow: inset 0 0 0 calc(var(--line-w) * 5) var(--frame-gap, var(--g-bg)), inset 0 0 0 calc(var(--line-w) * 6) color-mix(in srgb, currentColor 55%, transparent); }
/* the pattern is one gesture a page, not trim: the band along the foot of the hero (hero/style.css), or an inner page's header ornament; .b-motif and the
   sections that read --motif-band draw nothing (BRAND-directions.md 2.2, "motif") */
:root[data-sig-motif="pattern"] { --motif-band: none; }
:root[data-sig-motif="numbered"] .b-motif { counter-reset: b-num; }
:root[data-sig-motif="numbered"] .b-num::before { counter-increment: b-num; content: counter(b-num, decimal-leading-zero); font-variant-numeric: tabular-nums; }

/* the dish and menu hooks the signatures need (atoms/dish and atoms/list draw the rest; :root outranks their sheet): set on a section's own wrapper */
:root .sx-list--menu > li, :root .sx-list--menu-columns > li { padding-block: var(--item-pad, 1rem); border-bottom: var(--item-rule, var(--line-w) solid var(--line)); }
:root .sx-dish { justify-content: var(--dish-justify, normal); flex-wrap: var(--dish-wrap, nowrap); }
:root .sx-dish__dots { display: var(--dish-dots, block); }
:root .sx-dish__name { letter-spacing: var(--dish-name-track, inherit); }
:root .sx-dish__price { background: var(--dish-price-bg, transparent); padding: var(--dish-price-pad, 0); border-radius: var(--dish-price-radius, 0); transform: rotate(var(--dish-price-tilt, 0deg)); }

/* ---------------------------------------------------------------- 6. the section frame and layout */

.sx-section { padding-block: var(--section-pad); }
.sx-section--lg { padding-block: calc(var(--space-section) * 1.28); }
.sx-section--xl { padding-block: calc(var(--space-section) * 1.6); }
.sx-section--sm { padding-block: calc(var(--space-section) * .5); }
.sx-section--xs { padding-block: calc(var(--space-section) * .3); }
/* the section after a hero starts within the first scroll: half the padding above it, and the hero gives back some below */
.s-hero + .sx-section { padding-block-start: calc(var(--section-pad) * .5); }
.hero.s-hero, .s-hero.sx-section { padding-block-end: calc(var(--section-pad) * .55); }
.sx-section--intro { padding-block-end: var(--space-stack); }
.sx-section--none { padding-block: 0; }
.sx-section--footer { padding-block: calc(var(--space-section) * .75) 2rem; border-top: var(--line-w) solid var(--g-line); }
.sx-container { max-width: calc(var(--container) + 2 * var(--_gutter)); padding-inline: var(--_gutter); }

/* a look's own frame, inside the section: */
.b-stack { display: flex; flex-direction: column; gap: var(--space-stack); min-width: 0; }
.b-stack--tight { gap: calc(var(--space-stack) * .5); }
.b-stack--center { align-items: center; text-align: center; }
.b-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.b-row--center { justify-content: center; }
.b-head { display: flex; flex-direction: column; gap: .875rem; max-width: 46rem; }
.b-head--center { align-items: center; text-align: center; margin-inline: auto; }
.b-head--center .sx-text--heading, .b-head--center .sx-text--lead { margin-inline: auto; }
.b-measure { max-width: var(--measure); }

/* the grid: one column on a phone; -2, -3, -4 columns from the base's breakpoints; plain .b-grid fills 16rem columns */
.b-grid { display: grid; gap: var(--space-gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.b-grid--2, .b-grid--3, .b-grid--4 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 36rem) { .b-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 48rem) { .b-grid--2, .b-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 62rem) { .b-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .b-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.b-grid--rules { gap: 0; }
.b-grid--rules > * { border-top: var(--line-w) solid var(--g-line); padding-block: var(--space-stack); }

/* the split: words and a photo side by side from 62rem, stacked before */
.b-split { display: grid; gap: calc(var(--space-gap) * 2); align-items: center; }
@media (min-width: 62rem) { .b-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: calc(var(--space-gap) * 3); } }

/* reveal on scroll: CSS only, where supported, never with reduced motion; where unsupported the content is simply there */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .b-reveal { animation: b-reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
  }
}
@keyframes b-reveal { from { opacity: 0; transform: translateY(var(--reveal)); } }

/* ---------------------------------------------------------------- 7. motifs: ground patterns, corner pieces, motion styles (library/renderer/MOTIFS.md) */
/* Each applies only under its switch on <html>, so a page without one draws as before. Selectors are wrapped in :where() where they can be, so a section's own
   position or animation wins. render/layout writes: data-pattern-place (page|bands|hero) with --g-pattern-light (the pattern
   on a light ground, a faint ink) and --g-pattern-dark (on a dark ground, a faint light) on :root; a ground whose tone differs from the default
   below (the page and alt grounds of a dark direction, a light brand fill) re-points its --g-pattern in its ground block. Photo grounds, cards,
   forms, menus and the footer never take a pattern or a corner. */

/* where a pattern shows: page (every ground but photo, and the page itself), bands (the alt and brand grounds), hero (the first section) */
/* (the switch counts in the specificity, so a pattern beats the older sheets' `background` on body and the grounds; what it never reaches comes after) */
:root[data-pattern-place="page"] body,
:root[data-pattern-place="page"] :where([data-ground], .section-bg-surface, .section-bg-dark, .section-bg-accent):where(:not(:root)),
:root[data-pattern-place="bands"] :where([data-ground="alt"], .section-bg-surface, [data-ground="brand"], .section-bg-accent),
:root[data-pattern-place="hero"] :where(main > :first-child:not(.node), main > .node:first-child > section) {
  background-image: var(--_g-layers);
}
/* a motif that keeps words clear (data-pattern-clear="content" on the ground, or on <html> for every ground: render/layout's, for a clear motif): the quiet
   pattern (--g-pattern-quiet, at the body-text cap) over the whole ground, the ground's colour over the page column (--page-edge in from each side, at
   every width), and the strong pattern under both, so the strong one shows only in the margins and the words never sit on it */
:root, [data-ground], .section-bg-surface, .section-bg-dark, .section-bg-accent, .sx-section--cover, .hero--bg, .hb-card { --_g-layers: var(--g-pattern); }
[data-pattern-clear="content"],
:root[data-pattern-clear="content"] :where([data-ground], .section-bg-surface, .section-bg-dark, .section-bg-accent, .sx-section--cover, .hero--bg, .hb-card) {
  --_g-layers: var(--g-pattern-quiet, none),
    linear-gradient(to right, transparent var(--page-edge), var(--g-bg) var(--page-edge), var(--g-bg) calc(100% - var(--page-edge)), transparent calc(100% - var(--page-edge))),
    var(--g-pattern);
}
/* never: a photo ground, a hero card, and anything inside a card, a form, a menu or the footer; those surfaces are solid */
:root[data-pattern-place] :where([data-ground="photo"], .sx-section--cover, .hero--bg, .hb-card),
:root[data-pattern-place] :where(.b-card, .card, .b-panel, form, nav, footer, [data-chrome]) :where([data-ground], [class*="section-bg-"]) {
  background-image: none;
}
:where(:root[data-pattern-place]) :where(.b-card, .card, form, nav, body > header, body > footer, [data-chrome]) { background-color: var(--g-bg); }

/* corner pieces: render puts <span class="b-corner" data-corner="tl|tr|bl|br" aria-hidden="true">(an inline SVG)</span> as a direct child of a
   section, never in a photo ground, a card, a form, a menu or the footer. It sits in the section's padding, at its edge, under the words. */
:where(:has(> .b-corner)) { position: relative; overflow: clip; }
:where(.b-corner) {
  --_corner: clamp(3rem, 2rem + 4vw, 6rem);      /* smaller on a phone */
  --_corner-at: clamp(.5rem, .25rem + 1vw, 1.25rem);
  position: absolute;
  inline-size: var(--_corner);
  block-size: var(--_corner);
  pointer-events: none;
  z-index: 0;
  color: var(--g-brand-ink);
}
:where(.b-corner) > svg { display: block; inline-size: 100%; block-size: 100%; }
:where(.b-corner[data-corner="tl"]) { inset-block-start: var(--_corner-at); inset-inline-start: var(--_corner-at); }
:where(.b-corner[data-corner="tr"]) { inset-block-start: var(--_corner-at); inset-inline-end: var(--_corner-at); }
:where(.b-corner[data-corner="bl"]) { inset-block-end: var(--_corner-at); inset-inline-start: var(--_corner-at); }
:where(.b-corner[data-corner="br"]) { inset-block-end: var(--_corner-at); inset-inline-end: var(--_corner-at); }
:where(:has(> .b-corner)) > :where(:not(.b-corner)) { position: relative; z-index: 1; }
:where([data-ground="photo"], .sx-section--cover, .hero--bg, .b-card, .card, form, nav, footer, [data-chrome]) :where(.b-corner),
:where([data-ground="photo"], .sx-section--cover, .hero--bg) > :where(.b-corner) { display: none; }
@media (max-width: 23.99rem) { :where(.b-corner) { display: none; } }

/* motion styles: still, calm, crafted, lively, each over the motion tokens; reduced motion is always still (the tokens of 1 stand) */
@media (prefers-reduced-motion: no-preference) {
  :root[data-motion="still"] { --dur: 0ms; --ease: linear; --reveal: 0px; }
  :root:is([data-motion="calm"], [data-motion="crafted"]) { --dur: 180ms; --ease: cubic-bezier(.2, .7, .2, 1); --reveal: 12px; }
  :root[data-motion="lively"] { --dur: 200ms; --ease: cubic-bezier(.34, 1.4, .64, 1); --reveal: 16px; }
  :root[data-motion="still"] .sx-btn:not(.sx-btn-link):hover { transform: none; }

  /* cards lift on hover (crafted), with a slight spring (lively's ease) */
  :where(:root:is([data-motion="crafted"], [data-motion="lively"])) :where(.b-m-card) { transition: transform var(--dur) var(--ease); }
  @media (hover: hover) {
    :where(:root:is([data-motion="crafted"], [data-motion="lively"])) :where(.b-m-card):hover { transform: translateY(-3px); }
  }

  @supports (animation-timeline: view()) {
    /* calm and up: each section after the first fades up once as it arrives (scroll-driven: one already in view is simply there) */
    :where(:root:is([data-motion="calm"], [data-motion="crafted"], [data-motion="lively"])) :where(main > * + *) {
      animation: b-m-rise cubic-bezier(.2, .7, .2, 1) both; animation-timeline: view(); animation-range: entry 0% entry 45%;
    }
    /* crafted and up: list items one after another (each a little further into the scroll than the one before), corner pieces drift in */
    :where(:root:is([data-motion="crafted"], [data-motion="lively"])) :where(.b-m-item) {
      --_m-i: 0;
      animation: b-m-rise cubic-bezier(.2, .7, .2, 1) both; animation-timeline: view();
      animation-range: entry calc(var(--_m-i) * 5%) entry calc(40% + var(--_m-i) * 5%);
    }
    /* (an item counts by its own place, or by its list item's: a look marks the part it draws inside each [data-item]) */
    :where(.b-m-item:nth-child(2), [data-item]:nth-child(2) .b-m-item) { --_m-i: 1; }
    :where(.b-m-item:nth-child(3), [data-item]:nth-child(3) .b-m-item) { --_m-i: 2; }
    :where(.b-m-item:nth-child(n + 4), [data-item]:nth-child(n + 4) .b-m-item) { --_m-i: 3; }
    :where(:root:is([data-motion="crafted"], [data-motion="lively"])) :where(.b-corner) {
      animation: b-m-drift cubic-bezier(.2, .7, .2, 1) both; animation-timeline: view(); animation-range: entry 10% entry 60%;
    }
  }
  /* crafted and up: the hero photo moves at most 15% of the scroll, from a tablet up; the hook is its frame, which clips it */
  @media (min-width: 48rem) {
    @supports (animation-timeline: scroll()) {
      :where(:root:is([data-motion="crafted"], [data-motion="lively"])) :where(.b-m-hero-media) { overflow: clip; }
      :where(:root:is([data-motion="crafted"], [data-motion="lively"])) :where(.b-m-hero-media) > * {
        animation: b-m-parallax linear both; animation-timeline: scroll(root); animation-range: 0 100vh;
      }
    }
  }
}
:where(:root[data-motion="lively"]) :where(.b-m-figure) { font-variant-numeric: tabular-nums; }
@keyframes b-m-rise { from { opacity: 0; transform: translateY(var(--reveal)); } }
@keyframes b-m-drift { from { opacity: 0; transform: translate(0, var(--reveal)) rotate(-6deg); } }
@keyframes b-m-parallax { from { transform: scale(1.12) translateY(-5%); } to { transform: scale(1.12) translateY(5%); } }

/* the step from a display or heading to the words under it: a touch more than the head's gap, so descenders never sit on the lead */
:is(.sx-text--display, .sx-text--heading) + .sx-text--lead { margin-top: calc(var(--space-stack) * .25); }
/* What goes with one billing period only (a plan card's button for it), under atoms/billing's switch: shown while the switch shows that period, monthly first */
.b-only-yearly { display: none; }
[data-billing="annual"] .b-only-yearly { display: revert; }
[data-billing="annual"] .b-only-monthly { display: none; }
/* (atoms/period-switch draws the switch as radios, so it works before any script: the section reads which one is checked) */
.sx-section:has(.sx-period-switch__year:checked) .b-only-yearly { display: revert; }
.sx-section:has(.sx-period-switch__year:checked) .b-only-monthly { display: none; }