/* Links answer a pointer with light (after nickpyl.space). One rule for every link on the site pages, so nothing is
   left orange or plain (Sam, 2026-11-11: "all the links up here are missing the accent / shimmer? missing the
   gradient on hover?"). On hover or keyboard focus:
   - the sky's three colours (site.css --sky-grad) cross the link's letters once, the way the pointer came in
     (shimmer.js). The light is a background clipped to the link's own text over a layer in the link's colour, so at
     rest and at both ends of the pass the words look as they always do, and each line of a wrapped phrase gets its own pass;
   - its underline becomes a hairline in the same three colours. The underline is drawn as a background, never as a
     text decoration, because Safari paints decorations through a text-clipped background and showed two lines;
   - the phrases that open a story (.hole) and the "more" links (.go) also get a faint wash of the three behind them;
   - icons (the koi, the fish, arrows and chevrons) take the gradient as their stroke (#sky-stroke, shimmer.js).
   Links that are pictures (an avatar, an app icon, a cover) and links styled as cards keep their own hover.
   A 70ms delay keeps a cursor drifting over the page from setting links off. Only where a pointer can hover, never
   with reduced motion, and only in browsers that can derive the sky's colours. */
:root { --shim-w: 7em; --shim-t: 850ms; --shim-delay: 70ms; --shim-ease: cubic-bezier(.4, 0, .2, 1); }

@keyframes shim { from { background-position: calc(-1 * var(--shim-w)) 0, calc(-1 * var(--shim-w)) 0, 0 0, 0 100%, 0 0; }
  to { background-position: calc(100% + var(--shim-w)) 0, calc(100% + var(--shim-w)) 0, 0 0, 0 100%, 0 0; } }

@supports (color: oklch(from red l c h)) {
  @media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    :root :is(a[href]:not(.read, .thread, .dive, .rec, .door a, :has(img, picture, video, canvas)), .hole, .read .t, .thread mark):is(:hover, :focus-visible, .read:hover *, .read:focus-visible *, .thread:hover *, .thread:focus-visible *) {
      background-image: linear-gradient(90deg, currentColor, transparent 26% 74%, currentColor), var(--sky-grad), linear-gradient(currentColor, currentColor),
        var(--shim-u, var(--sky-grad)), var(--shim-wash, linear-gradient(transparent, transparent));
      background-size: var(--shim-w) 100%, var(--shim-w) 100%, 100% 100%, 100% 1.5px, 100% 100%;
      background-repeat: no-repeat;
      /* the underline sits at the foot of the content box, just below the descenders, where the old one was */
      background-origin: content-box, content-box, content-box, content-box, padding-box;
      -webkit-background-clip: text, text, text, content-box, padding-box; background-clip: text, text, text, content-box, padding-box;
      -webkit-box-decoration-break: clone; box-decoration-break: clone;
      text-decoration-line: none;
      -webkit-text-fill-color: transparent;
      animation: shim var(--shim-t) var(--shim-ease) var(--shim-delay) both;
      animation-direction: var(--shim-dir, normal);
    }
    :root :is(.hole, .go) { --shim-wash: var(--sky-wash); }
    /* pill-shaped navigation shows where you are with its own bar: the light only, no underline */
    :root :is(.idx, .nav) a { --shim-u: linear-gradient(transparent, transparent); }
    .go::after { -webkit-text-fill-color: currentColor; }
    :root .go:is(:hover, :focus-visible)::after { background: var(--sky-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
    :root :is(.nav, header) :is(a, button):is(:hover, :focus-visible) svg, :root .read:is(:hover, :focus-visible) svg { stroke: url(#sky-stroke); }
  }
}
/* the gradient that icons stroke with (shimmer.js puts it in the page) */
#sky-stroke .a { stop-color: var(--sky-c1, var(--accent)); }
#sky-stroke .b { stop-color: var(--sky-c3, var(--accent)); }
#sky-stroke .c { stop-color: var(--sky-c2, var(--accent)); }
