/* =========================================================
   particles.css — the tool cloud in the Work hero (particles.js)
   Space is reserved before the script runs (html.js), so nothing shifts.
   Without JS the figure is hidden: it is a companion to the writing, not content on its own.
   ========================================================= */
.wi-cloud { display: none; }
html.js .wi-cloud { display: flex; flex-direction: column; gap: 12px; margin: clamp(36px, 5vw, 56px) 0 0; max-width: 560px; }
.wi-cloud canvas { display: block; width: 100%; height: clamp(220px, 58vw, 320px); touch-action: pan-y; cursor: grab;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.wi-cloud.is-dragging canvas { cursor: grabbing; }
.wi-cloud figcaption { display: grid; gap: 10px; border-top: 1px solid var(--rule); padding-top: 12px; }
.wi-cloud-hint { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.wi-cloud-hint > span:first-child { margin-right: auto; }
/* "taps: n": a visitor's own mark, so plum; pressing it scatters the cloud too */
.wi-cloud-taps { position: relative; display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border: 1px solid var(--rule);
  border-radius: 999px; font: inherit; letter-spacing: inherit; text-transform: none; color: var(--ink-2); cursor: pointer;
  transition: border-color .25s var(--ease), color .25s var(--ease); -webkit-tap-highlight-color: transparent; }
.wi-cloud-taps::before { content: ""; position: absolute; inset: -8px -2px; }   /* a 40px target */
.wi-cloud-taps b { font-weight: 500; color: var(--play); font-variant-numeric: tabular-nums; display: inline-block; }
.wi-cloud-taps:hover, .wi-cloud-taps:focus-visible { border-color: var(--play); color: var(--ink); }
.wi-cloud-taps.is-bump b { animation: wi-tap-bump .35s var(--spring-bounce, ease); }
.wi-cloud-taps.is-scatter { animation: wi-tap-ring .7s var(--ease); }
@keyframes wi-tap-bump { 40% { transform: translateY(-3px) scale(1.2); } }
@keyframes wi-tap-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--play) 45%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
@media (prefers-reduced-motion: reduce) { .wi-cloud-taps.is-bump b, .wi-cloud-taps.is-scatter { animation: none; } .wi-cloud-taps.is-scatter { border-color: var(--play); } }
.wi-cloud-cap { margin: 0; min-height: calc(3 * 1.4em); font-family: var(--serif); font-size: 16px; line-height: 1.4; color: var(--ink-2); }
.wi-cloud-cap b { font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); margin-right: 6px; }
.wi-cloud-cap a { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.wi-cloud-keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 12px; margin: 0; padding: 0; list-style: none; }
.wi-cloud-keys button { display: flex; gap: 6px; align-items: baseline; min-height: 32px; padding: 0; text-align: left; font-family: var(--mono); font-size: 12px;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); transition: color .3s var(--ease); }
.wi-cloud-keys button span { color: var(--ink-3); }
.wi-cloud-keys button:hover, .wi-cloud-keys button:focus-visible { color: var(--accent); }
@media (hover: none), (pointer: coarse) { .wi-cloud-keys button { min-height: 40px; align-items: center; } }   /* a full finger target */
.wi-cloud-keys button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--accent); }

/* From 960px the hero is two columns: the writing on the left, the cloud in its own column on the right. */
@media (min-width: 960px) {
  html.js .wi-hero { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 34vw, 420px); grid-template-rows: auto auto 1fr;
    column-gap: clamp(32px, 5vw, 80px); align-items: start; }
  html.js .wi-hero > :not(.wi-cloud) { grid-column: 1; }
  html.js .wi-cloud { grid-column: 2; grid-row: 1 / -1; align-self: stretch; margin: 0; max-width: none; width: auto; min-height: 460px; }
  .wi-cloud canvas { flex: 1 1 auto; min-height: 260px; height: auto; }
}
@media (min-width: 960px) and (max-width: 1239px) { .wi-cloud-keys { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* The hero figures: labels never wrap, the arrow sits after the words. */
.wi-summary { flex-wrap: wrap; row-gap: 14px; }
.wi-summary .wi-sum-a { white-space: nowrap; padding: 10px 0; margin: -10px 0; }   /* a 36px+ target, same layout */
@media (max-width: 480px) { .wi-cloud-keys { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Phones: a smaller cloud, one hint line with the count on the right, and the six names as a tidy 3×2 grid of keys */
@media (max-width: 760px) {
  html.js .wi-cloud { margin-top: 32px; gap: 8px; max-width: none; }
  .wi-cloud canvas { height: clamp(180px, 50vw, 240px); }
  .wi-cloud figcaption { gap: 12px; }
  .wi-cloud-hint { flex-wrap: nowrap; }
  .wi-cloud-hint > span:nth-child(2) { display: none; }
  .wi-cloud-cap { min-height: calc(3 * 1.4em); text-wrap: pretty; }
  .wi-cloud-keys { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .wi-cloud-keys button, .wi-cloud-keys button[aria-pressed] { min-height: 44px; justify-content: center; align-items: center; padding: 0 4px; text-align: center;
    border: 1px solid var(--rule); border-radius: 8px; font-size: 11.5px; letter-spacing: .03em; white-space: nowrap; text-decoration: none; }
  .wi-cloud-keys button span { display: none; }
  .wi-cloud-keys button[aria-pressed="true"] { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
}
