/* The "Made with KScript" badge, for every site KScript serves. This file is
   the one copy: orimovo.co.uk, account.orimovo.co.uk and Outcoded load it from
   https://kscript.orimovo.co.uk/assets/badge/made-with-kscript.css, so a change
   here reaches them all. The art is the logo's own strokes from ../art/.
   The markup each site uses is in site/README.md ("Made with KScript").

   A pill of KScript glass with the bare \< mark. Hover or focus plays the
   logo's animation: the mark is selected and deleted, typed again as \> with
   a red squiggle, and fixed. CSS only, so a strict CSP needs no script.
   The colour rules are on a.ks-made so they hold against a site's own
   "footer a" colour; link this file after the site's stylesheet. */
a.ks-made {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px 4px 5px; border-radius: 9px;
  font: 700 13px/1.2 var(--font, 'Nunito Sans Variable', 'Nunito Sans', system-ui, sans-serif);
  letter-spacing: 0; color: #E9E6FF; text-decoration: none; white-space: nowrap;
  background: linear-gradient(135deg, rgba(138, 80, 255, 0.30), rgba(36, 92, 250, 0.20));
  -webkit-backdrop-filter: blur(12px) saturate(150%); backdrop-filter: blur(12px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 0 0 1px rgba(180, 140, 255, 0.32),
    0 8px 20px -10px rgba(88, 48, 220, 0.9);
  transition: box-shadow 0.2s ease, color 0.2s ease;
}
a.ks-made:hover, a.ks-made:focus-visible {
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), inset 0 0 0 1px rgba(48, 233, 193, 0.55),
    0 0 22px -6px rgba(4, 189, 252, 0.75);
}

/* The mark: stroke layers on a 26px square, cut from one render so they line
   up. A plane over the glyph holds the selection, squiggle and caret in the
   logo's 100-unit grid (26px * 0.8584 / 100 = 0.2232). */
.ks-made .ks-mark { position: relative; display: block; flex: none; width: 26px; height: 26px; }
.ks-made .ks-mark i { position: absolute; display: block; pointer-events: none; }
.ks-made .ks-bs, .ks-made .ks-gt, .ks-made .ks-chev { inset: 0; background: center / 100% 100% no-repeat; }
.ks-made .ks-bs { background-image: url(../art/k-small-bs.webp); }
.ks-made .ks-gt, .ks-made .ks-chev { background-image: url(../art/k-small-chev.webp); }
.ks-made .ks-p { left: 7.03%; top: 7.03%; width: 100px; height: 100px; transform-origin: 0 0; transform: scale(0.2232); }
.ks-made .ks-sel { left: 12px; top: 15px; width: 76px; height: 72px; border-radius: 6px; background: rgba(4, 189, 252, 0.35); box-shadow: inset 0 0 0 1px rgba(120, 220, 255, 0.6); }
.ks-made .ks-cur { left: 16px; top: 88px; width: 14px; height: 4.24px; background: url(../art/k-caret.webp) center / 100% 100% no-repeat; }
/* The typo: the < turned round and tinted coral, underlined in red. */
.ks-made .ks-gt { transform: scaleX(-1); transform-origin: 62.4% 50%; filter: hue-rotate(110deg) saturate(1.05); }
.ks-made .ks-sq { left: 46px; top: 81px; width: 32px; height: 8px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 6'%3E%3Cpath d='M1 4 4 1.5 7.5 4.5 11 1.5 14.5 4.5 18 1.5 21.5 4.5 25 1.5 28.5 4.5 32 1.5' fill='none' stroke='%23FF5A6E' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.ks-made .ks-sel, .ks-made .ks-cur, .ks-made .ks-gt, .ks-made .ks-sq { opacity: 0; }

/* The logo's keyframes (site.ks.css), under their own names so a page that
   has both never mixes them up. Every keyframe holds until the next, as a
   real caret jumps. */
.ks-made:is(:hover, :focus-visible) .ks-sel { animation: ks-made-sel 5.06s step-end both; }
.ks-made:is(:hover, :focus-visible) .ks-bs { animation: ks-made-bs 5.06s step-end both; }
.ks-made:is(:hover, :focus-visible) .ks-chev { animation: ks-made-chev 5.06s step-end both; }
.ks-made:is(:hover, :focus-visible) .ks-gt { animation: ks-made-gt 5.06s step-end both; }
.ks-made:is(:hover, :focus-visible) .ks-sq { animation: ks-made-sq 5.06s step-end both; }
.ks-made:is(:hover, :focus-visible) .ks-cur { animation: ks-made-cur 5.06s step-end both; }
@keyframes ks-made-sel { 0% { opacity: 1; } 12.85%, 100% { opacity: 0; } }
@keyframes ks-made-bs { 0% { opacity: 1; } 12.85% { opacity: 0; } 33.79%, 100% { opacity: 1; } }
@keyframes ks-made-chev { 0% { opacity: 1; } 12.85% { opacity: 0; } 68.58%, 100% { opacity: 1; } }
@keyframes ks-made-gt { 0% { opacity: 0; } 37.15% { opacity: 1; } 63.83%, 100% { opacity: 0; } }
@keyframes ks-made-sq { 0% { opacity: 0; } 46.05% { opacity: 1; } 63.83%, 100% { opacity: 0; } }
@keyframes ks-made-cur {
  0% { opacity: 0; transform: translateX(0); }
  12.85% { opacity: 1; transform: translateX(0); }
  23.32% { opacity: 0; transform: translateX(0); }
  33.79% { opacity: 1; transform: translateX(26px); }
  37.15% { opacity: 1; transform: translateX(54px); }
  63.83% { opacity: 1; transform: translateX(26px); }
  68.58% { opacity: 1; transform: translateX(54px); }
  79.05% { opacity: 0; transform: translateX(54px); }
  89.53% { opacity: 1; transform: translateX(54px); }
  100% { opacity: 0; transform: translateX(54px); }
}
/* A site with a light mode adds ks-made-adapts, and the badge turns to light
   glass when the device asks for light. Dark-only sites leave it off, so a
   light device never puts light glass on a dark footer. */
@media (prefers-color-scheme: light) {
  a.ks-made.ks-made-adapts {
    color: #3A2A8F;
    background: linear-gradient(135deg, rgba(138, 80, 255, 0.16), rgba(36, 92, 250, 0.10));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 0 0 1px rgba(124, 92, 230, 0.35),
      0 8px 20px -12px rgba(88, 48, 220, 0.45);
  }
  a.ks-made.ks-made-adapts:hover, a.ks-made.ks-made-adapts:focus-visible {
    color: #24166E;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 0 0 1px rgba(4, 150, 200, 0.6),
      0 0 22px -8px rgba(4, 189, 252, 0.6);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ks-made { transition: none; }
  .ks-made .ks-mark i { animation: none !important; }
}
