/* The drawn icons of the buttons (src/home/icons.mjs, CEO 10.11.2026, docs/decisions.md Schritt 83). Every icon has
   two states that stand still: at rest, and under the pointer of the link or button it stands in. Between them its
   ink moves like the ink of the round arrows: lines of pathLength 1 draw themselves or pull back with
   `stroke-dashoffset` (hidden is 1.05, not 1: a dash that ends at the end of a path still draws its round cap), parts
   move with `translate`, `rotate` and `scale`. The way in is drawn out (the curves of scripts/ink.ts), the way back is
   short. A press pushes the icon in, the rocket and the paper plane fly away.
   Only CSS: no script, so the icons work in every page that loads this file. Fine pointers only, and never with
   reduced motion: then the icon stands at rest, which carries the meaning. Every rule ends in an hm-ico part. */

.hm-ico {
  display: inline-block;
  flex: none;
  width: 1.25em;
  height: 1.25em;
  margin-left: .45em;
  vertical-align: -.28em;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: scale 160ms cubic-bezier(.23, 1, .32, 1);
}
/* Next to a label of weight 400 the line is as thin as its stem. */
.hm-ico--thin { stroke-width: 1.65; }

/* ---------- At rest ---------- */
.hm-ico__draw, .hm-ico__wipe, .hm-ico__leaf { stroke-dasharray: 1 1.2; }
.hm-ico__draw, .hm-ico__wipe { transition: stroke-dashoffset 200ms cubic-bezier(.23, 1, .32, 1); }
.hm-ico__draw { stroke-dashoffset: 1.05; }
.hm-ico__wipe { stroke-dashoffset: 0; }
.hm-ico__pop, .hm-ico__fade, .hm-ico__tick, .hm-ico__guard, .hm-ico__lid, .hm-ico__pupil, .hm-ico__sun { transform-box: fill-box; transform-origin: center; }
.hm-ico__pop { opacity: 0; scale: .3; transition: opacity 120ms ease, scale 160ms cubic-bezier(.23, 1, .32, 1), translate 160ms cubic-bezier(.23, 1, .32, 1); }
.hm-ico__fade { transition: opacity 160ms ease 60ms, scale 200ms cubic-bezier(.23, 1, .32, 1) 60ms; }

/* The moving parts, one icon after the other. Lengths are units of the 24 unit box. */
.hm-ico__lift { transition: translate 240ms cubic-bezier(.23, 1, .32, 1), opacity 160ms ease; }
.hm-ico--rocket .hm-ico__lift { translate: 0 1.4px; }
.hm-ico__nod { transform-origin: 12px 20px; transition: rotate 240ms cubic-bezier(.23, 1, .32, 1); }
.hm-ico__swirl { transform-origin: 12px 21px; transition: rotate 260ms cubic-bezier(.23, 1, .32, 1); }
.hm-ico__level { transform-origin: 12px 15.5px; transition: rotate 260ms cubic-bezier(.23, 1, .32, 1); }
.hm-ico__bubble { translate: -1px 9px; }
.hm-ico__spin { transform-origin: 10.5px 10.5px; transition: rotate 360ms cubic-bezier(.23, 1, .32, 1); }
.hm-ico__leaf { stroke-dashoffset: 1.05; }
.hm-ico__write { transition: translate 220ms cubic-bezier(.23, 1, .32, 1); }
.hm-ico__hop { translate: 0 2.5px; }
.hm-ico__greet { transition: translate 220ms cubic-bezier(.23, 1, .32, 1); }
.hm-ico__open { translate: 0 -2.5px; transition: translate 240ms cubic-bezier(.23, 1, .32, 1); }
.hm-ico__tick { scale: 1.18; transition: scale 220ms cubic-bezier(.23, 1, .32, 1); }
.hm-ico__fall { transition: translate 220ms cubic-bezier(.23, 1, .32, 1); }
.hm-ico__slide { translate: 0 0; transition: translate 220ms cubic-bezier(.23, 1, .32, 1); }
.hm-ico__node { fill: currentColor; fill-opacity: 0; transition: fill-opacity 160ms ease; }
.hm-ico__tile { transition: translate 220ms cubic-bezier(.23, 1, .32, 1); }
.hm-ico__knob { transition: translate 220ms cubic-bezier(.23, 1, .32, 1); }
.hm-ico__pupil { transition: translate 220ms cubic-bezier(.23, 1, .32, 1); }
.hm-ico__needle { transform-origin: 12px 12px; transition: rotate 320ms cubic-bezier(.23, 1, .32, 1); }
.hm-ico__solid { fill: currentColor; }
.hm-ico__sun { translate: 0 3.6px; scale: .8; transition: translate 260ms cubic-bezier(.23, 1, .32, 1), scale 260ms cubic-bezier(.23, 1, .32, 1); }

/* ---------- Under the pointer ---------- */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  :where(a, button:enabled):hover .hm-ico__draw { stroke-dashoffset: 0; transition: stroke-dashoffset 380ms cubic-bezier(.32, .72, 0, 1) 90ms; }
  :where(a, button:enabled):hover .hm-ico__wipe { stroke-dashoffset: 1.05; transition-duration: 180ms; }
  :where(a, button:enabled):hover .hm-ico__pop { opacity: 1; scale: 1; translate: 0 0; transition: opacity 140ms ease 120ms, scale 420ms cubic-bezier(.34, 1.56, .64, 1) 120ms, translate 420ms cubic-bezier(.34, 1.56, .64, 1) 120ms; }
  :where(a, button:enabled):hover .hm-ico__fade { opacity: 0; scale: .3; transition: opacity 100ms ease, scale 140ms cubic-bezier(.23, 1, .32, 1); }
  :where(a, button:enabled):hover .hm-ico__d1 { transition-delay: 190ms; }
  :where(a, button:enabled):hover .hm-ico__d2 { transition-delay: 290ms; }
  :where(a, button:enabled):hover .hm-ico__d3 { transition-delay: 400ms; }

  /* Rocket: it sinks a little, then lifts off (the curve dips below its start), the flame runs out of the nozzle. */
  :where(a, button:enabled):hover .hm-ico--rocket .hm-ico__lift { translate: 0 -1.7px; transition: translate 520ms cubic-bezier(.4, -.55, .25, 1); }
  :where(a, button:enabled):hover .hm-ico--rocket .hm-ico__draw { transition: stroke-dashoffset 300ms cubic-bezier(.32, .72, 0, 1) 200ms; }
  /* Paper plane: it glides off, the air draws behind it. */
  :where(a, button:enabled):hover .hm-ico--plane .hm-ico__lift { translate: 1.8px -1.8px; transition: translate 460ms cubic-bezier(.32, .72, 0, 1); }
  /* Calendar and sheet: they lean to the pen. */
  :where(a, button:enabled):hover .hm-ico__nod { rotate: -5deg; transition: rotate 420ms cubic-bezier(.32, .72, 0, 1); }
  /* Flask: it leans, the level stays flat, two bubbles rise out of the neck. */
  :where(a, button:enabled):hover .hm-ico__swirl { rotate: 13deg; transition: rotate 460ms cubic-bezier(.32, .72, 0, 1); }
  :where(a, button:enabled):hover .hm-ico__level { rotate: -13deg; transition: rotate 460ms cubic-bezier(.32, .72, 0, 1); }
  :where(a, button:enabled):hover .hm-ico__bubble { transition: opacity 140ms ease 160ms, scale 520ms cubic-bezier(.32, .72, 0, 1) 160ms, translate 620ms cubic-bezier(.32, .72, 0, 1) 160ms; }
  :where(a, button:enabled):hover .hm-ico__bubble.hm-ico__d1 { transition-delay: 300ms; }
  /* Magnifier: one turn around the lens. */
  :where(a, button:enabled):hover .hm-ico__spin { rotate: 360deg; transition: rotate 720ms cubic-bezier(.32, .72, 0, 1); }
  /* Book: the pages fly through while it opens, one after the other from right to left. */
  :where(a, button:enabled):hover .hm-ico__leaf { animation: hm-ico-leaf 300ms cubic-bezier(.25, .55, .4, 1) 130ms both; }
  :where(a, button:enabled):hover .hm-ico__leaf--2 { animation-delay: 220ms; }
  :where(a, button:enabled):hover .hm-ico__leaf--3 { animation-delay: 310ms; }
  :where(a, button:enabled):hover .hm-ico--book .hm-ico__draw { transition-duration: 420ms; }
  /* Pencil: it moves on, and its line grows behind the tip at the same pace. */
  :where(a, button:enabled):hover .hm-ico__write { translate: 4.4px 0; transition: translate 440ms cubic-bezier(.32, .72, 0, 1) 90ms; }
  :where(a, button:enabled):hover .hm-ico--pen .hm-ico__draw { transition: stroke-dashoffset 440ms cubic-bezier(.32, .72, 0, 1) 90ms; }
  /* The two founders: one hops and waves. */
  :where(a, button:enabled):hover .hm-ico__greet { translate: 0 -1px; transition: translate 420ms cubic-bezier(.34, 1.56, .64, 1); }
  :where(a, button:enabled):hover .hm-ico--people .hm-ico__draw { animation: hm-ico-wave 560ms cubic-bezier(.32, .72, 0, 1) 300ms both; transform-origin: 19.2px 15.6px; }
  /* Envelope: it sinks while the flap opens. */
  :where(a, button:enabled):hover .hm-ico__open { translate: 0 0; transition: translate 420ms cubic-bezier(.32, .72, 0, 1); }
  :where(a, button:enabled):hover .hm-ico--envelope .hm-ico__draw { transition-delay: 150ms; }
  /* Tick: the ring closes around it, the tick answers. */
  :where(a, button:enabled):hover .hm-ico--check .hm-ico__draw { transition: stroke-dashoffset 520ms cubic-bezier(.32, .72, 0, 1); }
  :where(a, button:enabled):hover .hm-ico__tick { scale: .92; transition: scale 420ms cubic-bezier(.34, 1.56, .64, 1) 200ms; }
  /* Download: the arrow lands in the tray. */
  :where(a, button:enabled):hover .hm-ico__fall { translate: 0 3px; transition: translate 460ms cubic-bezier(.34, 1.56, .64, 1); }
  /* Copy: the front sheet comes off. */
  :where(a, button:enabled):hover .hm-ico__slide { translate: 1.6px 1.6px; transition: translate 420ms cubic-bezier(.32, .72, 0, 1); }
  /* Steps: one after the other fills. */
  :where(a, button:enabled):hover .hm-ico__node { fill-opacity: 1; transition: fill-opacity 200ms ease; }
  :where(a, button:enabled):hover .hm-ico__node.hm-ico__d1 { transition-delay: 150ms; }
  :where(a, button:enabled):hover .hm-ico__node.hm-ico__d2 { transition-delay: 300ms; }
  /* Tiles: they step apart. */
  :where(a, button:enabled):hover .hm-ico__tile { transition: translate 420ms cubic-bezier(.32, .72, 0, 1); }
  :where(a, button:enabled):hover .hm-ico__tile--1 { translate: -.9px -.9px; }
  :where(a, button:enabled):hover .hm-ico__tile--2 { translate: .9px -.9px; }
  :where(a, button:enabled):hover .hm-ico__tile--3 { translate: -.9px .9px; }
  :where(a, button:enabled):hover .hm-ico__tile--4 { translate: .9px .9px; }
  /* Door: the knob goes with the leaf. */
  :where(a, button:enabled):hover .hm-ico__knob { translate: -4.4px .9px; transition: translate 420ms cubic-bezier(.32, .72, 0, 1) 90ms; }
  /* Eye: one blink, then it looks at the label. */
  :where(a, button:enabled):hover .hm-ico__lid, :where(a, button:enabled):hover .hm-ico__pupil { animation: hm-ico-blink 300ms cubic-bezier(.32, .72, 0, 1) both; }
  :where(a, button:enabled):hover .hm-ico__pupil { translate: -2.4px 0; transition: translate 420ms cubic-bezier(.32, .72, 0, 1) 140ms; }
  /* Compass: the needle swings to its new course and settles. */
  :where(a, button:enabled):hover .hm-ico__needle { rotate: -90deg; transition: rotate 700ms cubic-bezier(.3, 1.45, .45, 1); }
  /* Shield: it answers the tick. */
  :where(a, button:enabled):hover .hm-ico__guard { animation: hm-ico-pulse 460ms cubic-bezier(.32, .72, 0, 1) 120ms both; }
  /* Mountains: the sun rises, then its rays. */
  :where(a, button:enabled):hover .hm-ico__sun { translate: 0 0; scale: 1; transition: translate 520ms cubic-bezier(.32, .72, 0, 1), scale 520ms cubic-bezier(.32, .72, 0, 1); }
}

/* ---------- A press ---------- */
@media (prefers-reduced-motion: no-preference) {
  :where(a, button:enabled):active .hm-ico { scale: .86; transition-duration: 100ms; }
  :where(a, button:enabled):active .hm-ico--rocket .hm-ico__lift { translate: 0 -13px; opacity: 0; transition: translate 320ms cubic-bezier(.45, 0, .8, .5), opacity 140ms ease 170ms; }
  :where(a, button:enabled):active .hm-ico--plane .hm-ico__lift { translate: 11px -11px; opacity: 0; transition: translate 320ms cubic-bezier(.45, 0, .8, .5), opacity 140ms ease 170ms; }
}

/* A page of the book: a dash that runs along its line once. */
@keyframes hm-ico-leaf {
  from { stroke-dashoffset: 1.05; }
  45% { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -1.05; }
}
@keyframes hm-ico-wave {
  from { stroke-dashoffset: 1.05; rotate: 0deg; }
  45% { stroke-dashoffset: 0; rotate: 16deg; }
  72% { stroke-dashoffset: 0; rotate: -7deg; }
  to { stroke-dashoffset: 0; rotate: 0deg; }
}
@keyframes hm-ico-blink {
  45% { scale: 1 .12; }
}
@keyframes hm-ico-pulse {
  40% { scale: 1.09; }
}
