@property --arc-entry-drop {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}
@media(prefers-reduced-motion:no-preference) {
  /* The hit target wakes with the face; keyboard focus can skip the reveal. */
  .arc-key-entry-ready .btn[data-arc-enter],
  .arc-key-entry-ready .btn[data-arc-enter] > * { pointer-events:none !important; }

  .arc-key-entry-ready .btn[data-arc-enter] {
    --arc-entry-drop:calc(var(--arc-face-h) + var(--d) + 22px);
    --arc-entry-cut:calc(50% + var(--arc-entry-drop) - var(--arc-face-h) / 2 - var(--d));
  }
  .arc-key-entry-ready .btn[data-arc-enter="rise"] {
    --arc-entry-drop:0px;
    transition:--arc-entry-drop .26s cubic-bezier(.22,.8,.27,1);
  }
  .arc-key-entry-ready .btn[data-arc-enter] > :is(.arc-recess-socket,.arc-recess-rim) {
    opacity:1;
    transition:none;
    mask-image:none;
  }
  .arc-key-entry-ready .btn[data-arc-enter]:not([data-arc-enter="queued"]) > :is(.arc-recess-socket,.arc-recess-rim) {
    mask-size:8px 8px;
    mask-repeat:repeat;
    animation:ace-key-socket-dither 34ms steps(1,end) both;
  }
  .arc-key-entry-ready .btn[data-arc-enter]:not([data-arc-enter="queued"]) > .arc-recess-socket {
    animation-duration:56ms;
    animation-delay:28ms;
  }
  .arc-key-entry-ready .btn[data-arc-enter] > .arc-recess-rim::before,
  .arc-key-entry-ready .btn[data-arc-enter] > .arc-recess-rim::after { mask-image:none; }
  .arc-key-entry-ready .btn[data-arc-enter="queued"] > :is(.arc-recess-socket,.arc-recess-rim) {opacity:0}
  .arc-key-entry-ready .btn[data-arc-enter]::before {
    --arc-drop:var(--arc-entry-drop);
    background:var(--face);
    transition:none;
  }
  .arc-key-entry-ready .btn[data-arc-enter]::after {opacity:0}
  .arc-key-entry-ready .btn[data-arc-enter="rise"]::after {
    opacity:1;
    transition:opacity .085s steps(3,end) .165s;
  }
  .arc-key-entry-ready .btn[data-arc-enter] > :is(.btn-text,.ace-key-icon) {
    transform:translateY(var(--arc-entry-drop));
    clip-path:inset(-2px -2px max(0px,var(--arc-entry-cut)) -2px);
    transition:none;
    animation:none;
  }
}

/* Deliberate focus or press takes priority over the decorative entrance. */
.btn.arc-key-entry-fast::before,.btn.arc-key-entry-fast::after,
.btn.arc-key-entry-fast > :is(.arc-recess-socket,.arc-recess-rim,.btn-text,.ace-key-icon) { transition:none !important; }

@media(prefers-reduced-motion:no-preference) {
  /* Do not paint the fixed back rim on top of a cap rising through it. */
  .arc-key-entry-ready .btn[data-arc-enter="rise"] > .arc-recess-rim { z-index:-2; }
  .arc-key-entry-ready .btn[data-arc-enter="queued"]::before,
  .arc-key-entry-ready .btn[data-arc-enter="queued"] > :is(.btn-text,.ace-key-icon),
  .arc-key-entry-ready .btn[data-arc-enter="socket"]::before,
  .arc-key-entry-ready .btn[data-arc-enter="socket"] > :is(.btn-text,.ace-key-icon) {visibility:hidden;}
}

/* Binary ordered-dither masks. A CSS pixel is painted at full ink or not at all. */
@keyframes ace-key-socket-dither {
  0% { mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%278%27%20height%3D%278%27%20viewBox%3D%270%200%208%208%27%20shape-rendering%3D%27crispEdges%27%3E%3Cpath%20fill%3D%27white%27%20d%3D%27%27%2F%3E%3C%2Fsvg%3E"); }
  25% { mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%278%27%20height%3D%278%27%20viewBox%3D%270%200%208%208%27%20shape-rendering%3D%27crispEdges%27%3E%3Cpath%20fill%3D%27white%27%20d%3D%27M0%200h2v2h-2zM4%200h2v2h-2zM0%204h2v2h-2zM4%204h2v2h-2z%27%2F%3E%3C%2Fsvg%3E"); }
  50% { mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%278%27%20height%3D%278%27%20viewBox%3D%270%200%208%208%27%20shape-rendering%3D%27crispEdges%27%3E%3Cpath%20fill%3D%27white%27%20d%3D%27M0%200h2v2h-2zM4%200h2v2h-2zM2%202h2v2h-2zM6%202h2v2h-2zM0%204h2v2h-2zM4%204h2v2h-2zM2%206h2v2h-2zM6%206h2v2h-2z%27%2F%3E%3C%2Fsvg%3E"); }
  75% { mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20width%3D%278%27%20height%3D%278%27%20viewBox%3D%270%200%208%208%27%20shape-rendering%3D%27crispEdges%27%3E%3Cpath%20fill%3D%27white%27%20d%3D%27M0%200h2v2h-2zM2%200h2v2h-2zM4%200h2v2h-2zM6%200h2v2h-2zM2%202h2v2h-2zM6%202h2v2h-2zM0%204h2v2h-2zM2%204h2v2h-2zM4%204h2v2h-2zM6%204h2v2h-2zM2%206h2v2h-2zM6%206h2v2h-2z%27%2F%3E%3C%2Fsvg%3E"); }
  100% { mask-image:none; }
}

@media(prefers-reduced-motion:no-preference){
  .arc-key-entry-ready :is(.nav,.hero) [data-arc-enter="rise"].btn { transition-duration: .225s; }
  .arc-key-entry-ready :is(.nav,.hero) [data-arc-enter="rise"].btn::after { transition: opacity .075s steps(3,end) .145s; }
}
