/* Plucked underline adapted from https://microinteractions.dev/plucked-underline/
   Copyright (c) 2026 Juan Di Nella. MIT: licenses/microinteractions.txt
   Used on the nav words (night homepage + Skills & Tools page). The link keeps the nav's own
   type; the string is drawn in the accent purple. --pluck-ease is a damped oscillation: past
   flat, back, and settled in about 2.5 cycles. */
plucked-underline { display: contents; }   /* only wires up its link; the link stays the flex item */

.pluck-link {
  --pluck-x: 50%;
  --pluck-duration: 720ms;
  --pluck-open: 140ms;
  --pluck-close: 110ms;
  --pluck-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --pluck-ease: linear(
    0, 0.157, 0.424, 0.741, 1.051, 1.304, 1.471, 1.536, 1.506, 1.401, 1.247,
    1.078, 0.923, 0.804, 0.734, 0.718, 0.749, 0.815, 0.9, 0.989, 1.065, 1.119,
    1.146, 1.146, 1.122, 1.083, 1.036, 0.991, 0.954, 0.931, 0.922, 0.926,
    0.942, 0.965, 0.989, 1.012, 1
  );
  position: relative; display: inline-flex; align-items: center; min-height: 44px;
  max-width: 100%; white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.pluck-text { overflow: hidden; text-overflow: ellipsis; }
.pluck-link:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; border-radius: 8px; }

.pluck-string {
  position: absolute; bottom: 4px; left: 10px; width: calc(100% - 20px); height: 12px;
  overflow: visible; pointer-events: none; color: var(--accent, currentColor);
  /* Closed into the pluck point. The negative insets leave room for the swing. */
  clip-path: inset(-4px calc(100% - var(--pluck-x)) -4px var(--pluck-x));
  transition: clip-path var(--pluck-close) var(--pluck-ease-out);
}
.pluck-string path {
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
  vector-effect: non-scaling-stroke; transform-box: view-box; transform-origin: 50% 50%;
}
/* The -1px sides keep the round caps. */
.pluck-link[data-plucked] .pluck-string { clip-path: inset(-4px -1px); transition-duration: var(--pluck-open); }
/* Flattening the bend with scaleY keeps the path data fixed; scaleY(0) would leave nothing to stroke. */
.pluck-link[data-ringing] .pluck-string path { transform: scaleY(0.001); transition: transform var(--pluck-duration) var(--pluck-ease); }
.pluck-link:focus-visible .pluck-string { clip-path: inset(-4px -1px); transition: none; }
.pluck-link:focus-visible .pluck-string path { transform: scaleY(0.001); transition: none; }
@media (prefers-reduced-motion: reduce) {
  .pluck-link .pluck-string, .pluck-link .pluck-string path { transition: none; }
}
