/* WEBCRAFT interaction primitives v1.0.0
 * Based on verified editorial V10 timings, re-engineered to avoid global selectors.
 * Opt in with .webcraft on an existing ancestor and data-webcraft on native controls.
 * Does not create forms, dialogs, layout, typography, colors or site navigation.
 */
.webcraft {
  --wc-ease: cubic-bezier(.22,.8,.2,1);
  --wc-t-action: 220ms;
  --wc-t-card: 260ms;
  --wc-t-color: 180ms;
  --wc-lift-action: -3px;
  --wc-lift-card: -4px;
  --wc-lift-chip: -2px;
  --wc-shadow-action: 0 12px 26px rgb(37 27 37 / .12), 0 3px 8px rgb(37 27 37 / .05);
  --wc-shadow-card: 0 16px 34px rgb(36 29 36 / .105), 0 4px 12px rgb(36 29 36 / .045);
  --wc-shadow-chip: 0 6px 13px rgb(37 27 37 / .08);
  --wc-shadow-selected: 0 3px 10px rgb(38 38 43 / .12);
  /* Supply this from the actual brand/theme; currentColor is only a fallback. */
  --wc-focus: currentColor;
  --wc-focus-width: 3px;
  --wc-focus-offset: 4px;
}
/* Variants are optional. They change only motion intensity, never the brand. */
.webcraft[data-webcraft-intensity="quiet"] {
  --wc-lift-action: -2px;
  --wc-lift-card: -2px;
  --wc-lift-chip: -1px;
}
.webcraft[data-webcraft-intensity="still"] {
  --wc-lift-action: 0px;
  --wc-lift-card: 0px;
  --wc-lift-chip: 0px;
}
/* Semantic, opt-in controls only. No width, height, grid, font, colors, URL or pointer-event rules. */
.webcraft :is(a, button)[data-webcraft="action"],
.webcraft :is(a, button)[data-webcraft="chip"],
.webcraft a[data-webcraft="card"] {
  transition-property: translate, box-shadow, border-color, background-color, color;
  transition-duration: var(--wc-t-action), var(--wc-t-action), var(--wc-t-color), var(--wc-t-color), var(--wc-t-color);
  transition-timing-function: var(--wc-ease);
}
.webcraft a[data-webcraft="card"] {
  transition-duration: var(--wc-t-card), var(--wc-t-card), var(--wc-t-color), var(--wc-t-color), var(--wc-t-color);
}
.webcraft a[data-webcraft="link"] {
  transition: color 170ms ease, text-decoration-color 170ms ease, opacity 170ms ease;
}
/* Focus is always visible, including when users prefer reduced motion. */
.webcraft :is(a, button)[data-webcraft]:focus-visible {
  outline: var(--wc-focus-width) solid var(--wc-focus);
  outline-offset: var(--wc-focus-offset);
}
/* Native disabled and semantic busy state do not pretend to be clickable. */
.webcraft button[data-webcraft]:disabled,
.webcraft :is(a, button)[data-webcraft][aria-disabled="true"],
.webcraft :is(a, button)[data-webcraft][aria-busy="true"] {
  translate: none;
  box-shadow: none;
}
/* Selected chip: persistent, not a transient hover. Selected color stays with the host brand. */
.webcraft :is(a, button)[data-webcraft="chip"]:is([aria-pressed="true"],[aria-selected="true"],[aria-current="page"]),
.webcraft :is(a, button)[data-webcraft="action"][aria-current="page"] {
  box-shadow: var(--wc-shadow-selected);
}
/* Deliberate hover only for fine mouse/pointer; preserve inherited transform independently. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .webcraft :is(a, button)[data-webcraft="action"]:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]):hover {
    translate: 0 var(--wc-lift-action);
    box-shadow: var(--wc-shadow-action);
  }
  .webcraft a[data-webcraft="card"]:not([aria-disabled="true"]):hover {
    translate: 0 var(--wc-lift-card);
    box-shadow: var(--wc-shadow-card);
  }
  .webcraft :is(a, button)[data-webcraft="chip"]:not(:disabled):not([aria-disabled="true"]):hover {
    translate: 0 var(--wc-lift-chip);
    box-shadow: var(--wc-shadow-chip);
  }
  .webcraft :is(a, button)[data-webcraft="action"]:not(:disabled):not([aria-disabled="true"]):active,
  .webcraft a[data-webcraft="card"]:not([aria-disabled="true"]):active,
  .webcraft :is(a, button)[data-webcraft="chip"]:not(:disabled):not([aria-disabled="true"]):active {
    translate: 0 -1px;
  }
}
/* Respect system settings; no global scroll-behavior or image animation overrides. */
@media (prefers-reduced-motion: reduce) {
  .webcraft :is(a, button)[data-webcraft] {
    transition-duration: 0.01ms;
    translate: none;
  }
}
/* Forced-contrast mode cannot rely on shadow for focus or selection. */
@media (forced-colors: active) {
  .webcraft :is(a, button)[data-webcraft]:focus-visible {
    outline: 2px solid Highlight;
    outline-offset: 3px;
  }
  .webcraft :is(a, button)[data-webcraft="chip"]:is([aria-pressed="true"],[aria-selected="true"],[aria-current="page"]) {
    outline: 1px solid Highlight;
  }
}
