/*
 * skills.raq.com keycaps (Alex, 22 Nov 2026: "hero and concept for keycaps"): raq.com's graphite tool keys, one
 * neutral style for every subject with a warm glyph, the provider-logo reel in the headline, the curved ribbon of
 * subject keys and the closing band. The pages around them come from agent.css.
 */
:root {
  --ka-ground: #f6f7f8;
  --ka-panel: #ffffff;
  --ka-rim: #e2e6eb;
  --ka-rim-2: #d3d9e0;
  --ka-glyph: #f5c6a5;
  --ka-glow: rgb(245 170 125 / 42%);
  --ka-shadow-tile: 0 1px 2px #1c1f2a12, 0 12px 28px -10px #1c1f2a30;
  --ka-shadow-panel: 0 1px 1px #1c1f2a0a, 0 2px 6px #1c1f2a08, 0 30px 70px -28px #1c1f2a45;
  --ka-ease: cubic-bezier(.22, 1, .36, 1);
}
body.ka { background: var(--ka-ground); }
body.ka > main { padding-top: 96px; }
.ka .sk-bar .nvo-cap-shell::before { background: rgb(255 255 255 / 86%); }
/* ---------- Keycap ---------- */
.ka-key {
  --s: 56px;
  position: relative;
  display: inline-grid;
  flex: none;
  width: var(--s);
  height: var(--s);
  border-radius: 27%;
  background: linear-gradient(180deg, #30343e 0%, #1a1c22 55%, #121317 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 12%),
    inset 0 -2px 3px rgb(0 0 0 / 55%),
    0 calc(var(--s) * .045) 0 #0b0c0f,
    0 calc(var(--s) * .2) calc(var(--s) * .32) calc(var(--s) * -.1) rgb(14 16 22 / 58%),
    0 1px 3px rgb(14 16 22 / 22%);
  transition: transform .45s var(--ka-ease), box-shadow .45s var(--ka-ease);
}
.ka-key-cap {
  position: absolute;
  inset: 6% 7.5% 14% 7.5%;
  display: grid;
  place-items: center;
  border-radius: 23%;
  background: radial-gradient(120% 95% at 32% 12%, #4d5360 0%, #2c3039 46%, #1d2027 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 20%), inset 0 -1px 1px rgb(0 0 0 / 45%), 0 1px 2px rgb(0 0 0 / 45%);
}
.ka-key svg { width: 46%; height: 46%; color: var(--ka-glyph); stroke-width: 1.7; filter: drop-shadow(0 0 calc(var(--s) * .07) var(--ka-glow)); }
.ka-key-xs { --s: 26px; }
.ka-key-xs svg { width: 54%; height: 54%; stroke-width: 2.1; filter: none; }
.ka-key-sm { --s: 44px; }
.ka-key-md { --s: 54px; }
.ka-key-lg { --s: 72px; }
.ka-key-xl { --s: clamp(60px, 6vw, 92px); }

/* ---------- Hero ---------- */
.ka-hero { position: relative; padding-top: clamp(28px, 3.6vw, 56px); text-align: center; overflow-x: clip; }
.ka-hero::before { content: ""; position: absolute; inset: -140px 0 auto; height: 900px; z-index: -1; pointer-events: none; background: radial-gradient(60% 55% at 50% 30%, #ffffff 0%, rgb(255 255 255 / 0%) 70%), repeating-radial-gradient(circle at 50% 118%, transparent 0 78px, rgb(25 27 34 / 3.5%) 78px 79px); }
.ka-hero h1 { font-size: clamp(50px, 8.1vw, 124px); line-height: .95; letter-spacing: -.058em; font-weight: 600; padding-bottom: .05em; }
.ka-line { display: block; }
.ka-reel { position: relative; display: inline-block; width: .74em; height: .74em; overflow: hidden; margin: 0 -.03em; vertical-align: -.06em; -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); }
.ka-reel-track { display: flex; flex-direction: column; animation: ka-reel 11s var(--ka-ease) infinite; }
.ka-reel img { flex: none; width: .74em; height: .74em; padding: .07em; }
@keyframes ka-reel {
  0%, 19% { transform: translateY(0); }
  25%, 44% { transform: translateY(-20%); }
  50%, 69% { transform: translateY(-40%); }
  75%, 94% { transform: translateY(-60%); }
  100% { transform: translateY(-80%); }
}
.ka-intro { max-width: 660px; margin: 30px auto 0; font-size: clamp(18px, 1.55vw, 21px); line-height: 1.55; color: var(--muted); text-wrap: balance; }
.ka-search { display: flex; align-items: center; gap: 8px; width: min(640px, 100%); height: 70px; margin: 38px auto 0; padding: 7px 7px 7px 24px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px var(--ka-rim), var(--ka-shadow-panel); transition: box-shadow .2s; }
.ka-search:focus-within { box-shadow: 0 0 0 1.5px var(--ink), var(--ka-shadow-panel); }
.ka-search > svg { flex: none; width: 21px; height: 21px; color: var(--faint); }
.ka-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 18px; }
.ka-search input::placeholder { color: #80858f; }
.ka-search .pill { min-height: 56px; padding: 0 24px; }
.ka-after { margin-top: 18px; font-size: 15px; color: var(--muted); }

/* The 13 subjects on a curved, gently drifting ribbon of keys */
.ka-ribbon { position: relative; margin-top: clamp(52px, 5.6vw, 84px); padding-bottom: clamp(120px, 11vw, 170px); perspective: 1300px; }
.ka-ribbon ul { display: flex; justify-content: center; gap: clamp(10px, 1.15vw, 18px); list-style: none; transform: rotateX(calc(14deg + var(--ry, 0deg))) rotateY(var(--rx, 0deg)); transform-style: preserve-3d; transition: transform .8s var(--ka-ease); }
.ka-ribbon li { transform: translateY(calc(var(--d) * var(--d) * -2.3px)) rotate(calc(var(--d) * -2.3deg)); }
/* The key floats, not the link around it, and the key you point at holds still (Alex, 22 Nov 2026: hover was glitchy). */
.ka-ribbon a { position: relative; display: block; border-radius: 27%; text-decoration: none; }
.ka-ribbon .ka-key { animation: ka-drift 6.5s ease-in-out infinite; animation-delay: calc(var(--i) * -.5s); }
.ka-ribbon a:hover .ka-key, .ka-ribbon a:focus-visible .ka-key { animation-play-state: paused; }
@keyframes ka-drift { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
@media (min-width: 901px) {
  /* The gaps between keys count as the key, so the pointer never falls between targets. */
  .ka-ribbon a::before { content: ""; position: absolute; inset: -12px -10px -18px; }
}
.ka-ribbon a:hover .ka-key, .ka-ribbon a:focus-visible .ka-key { transform: translateY(-12px) scale(1.05); box-shadow: inset 0 1px 0 rgb(255 255 255 / 14%), inset 0 -2px 3px rgb(0 0 0 / 55%), 0 calc(var(--s) * .045) 0 #0b0c0f, 0 calc(var(--s) * .45) calc(var(--s) * .5) calc(var(--s) * -.14) rgb(14 16 22 / 50%), 0 1px 3px rgb(14 16 22 / 22%); }
.ka-ribbon a:hover svg, .ka-ribbon a:focus-visible svg { color: #ffe0c8; }
.ka-ribbon a:focus-visible { outline-offset: 6px; border-radius: 22px; }
.ka-tip { position: absolute; left: 50%; top: calc(100% + 16px); z-index: 2; display: grid; gap: 1px; padding: 9px 14px; border-radius: 13px; background: #fff; box-shadow: 0 0 0 1px var(--ka-rim), var(--ka-shadow-tile); font-size: 13px; line-height: 1.35; color: var(--muted); white-space: nowrap; pointer-events: none; opacity: 0; transform: translate(-50%, 8px) rotate(calc(var(--d) * 2.5deg)); transition: opacity .25s, transform .35s var(--ka-ease); }
.ka-tip b { font-size: 14px; font-weight: 600; color: var(--ink); }
.ka-name { display: none; }
.ka-ribbon a:hover .ka-tip, .ka-ribbon a:focus-visible .ka-tip { opacity: 1; transform: translate(-50%, 0) rotate(calc(var(--d) * 2.5deg)); }
@keyframes ka-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* ---------- Closing band ---------- */
/* A contained graphite card inside the page, with room above and below (Alex, 22 Nov 2026). */
main:has(> .ka-closing:last-child) { padding-bottom: clamp(20px, 3vw, 40px); }
.ka-closing { position: relative; width: calc(100% - var(--gutter) * 2); max-width: 1360px; margin: 0 auto; overflow: hidden; border-radius: 32px; padding-top: clamp(64px, 7vw, 96px); background: radial-gradient(70% 90% at 50% 120%, #2d323d 0%, #15171c 55%, #111318 100%); color: #fff; text-align: center; }
.ka-closing-inner h2 { max-width: 18ch; margin: 0 auto; font-size: clamp(34px, 4vw, 54px); line-height: 1.02; letter-spacing: -.045em; padding-bottom: .04em; }
.ka-closing-inner p { max-width: 640px; margin: 26px auto 0; font-size: 18.5px; color: #b7bcc6; }
.ka-closing-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 24px; margin-top: 36px; }
.ka-closing .link { color: #fff; text-decoration-color: rgb(255 255 255 / 35%); }
.ka-closing .link:hover { text-decoration-color: #fff; }
.ka-closing-keys { display: flex; justify-content: center; gap: clamp(10px, 1.6vw, 22px); height: clamp(90px, 9vw, 120px); margin-top: clamp(40px, 5vw, 60px); perspective: 900px; }
.ka-closing-keys > span { transform: translateY(calc(var(--i) * var(--i) * 7px + 26px)) rotate(calc(var(--i) * -3.2deg)); }
.ka-closing-keys .ka-key { --s: clamp(54px, 6vw, 84px); box-shadow: inset 0 1px 0 rgb(255 255 255 / 16%), inset 0 -2px 3px rgb(0 0 0 / 55%), 0 calc(var(--s) * .045) 0 #08090b, 0 0 0 1px rgb(255 255 255 / 5%), 0 30px 50px -20px rgb(0 0 0 / 70%); }

/* A subject's key on its skill and subject pages */
.ka-skill-key { display: inline-block; border-radius: 27%; animation: ka-float 6.5s ease-in-out infinite; }
a.ka-skill-key:hover .ka-key { transform: translateY(-6px); }


/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  /* Phones and small tablets: the keys become a row you swipe, each with its subject's name under it. */
  .ka-ribbon { perspective: none; margin-top: 44px; padding-bottom: 36px; }
  .ka-ribbon ul { justify-content: flex-start; gap: 4px; overflow-x: auto; padding: 14px var(--gutter) 6px; transform: none; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent); mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent); }
  .ka-ribbon ul::-webkit-scrollbar { display: none; }
  .ka-ribbon li { flex: none; transform: none; scroll-snap-align: start; }
  .ka-ribbon a { display: grid; justify-items: center; align-content: start; gap: 12px; width: 88px; border-radius: 18px; }
  .ka-ribbon .ka-key { animation: none; }
  .ka-ribbon .ka-key-xl { --s: 62px; }
  .ka-ribbon a:hover .ka-key, .ka-ribbon a:focus-visible .ka-key { transform: translateY(-4px); }
  .ka-tip { display: none; }
  .ka-name { display: block; font-size: 12.5px; font-weight: 500; line-height: 1.25; color: var(--ink-2); text-wrap: balance; }
}
@media (max-width: 1023px) {
  body.ka > main { padding-top: 88px; }
}
@media (max-width: 760px) {
  body.ka > main { padding-top: 84px; }
.ka-hero { padding-top: 28px; }
  .ka-hero h1 { font-size: clamp(44px, 12.6vw, 76px); }
  .ka-intro { margin-top: 22px; font-size: 17.5px; }
  .ka-search { height: 60px; margin-top: 28px; padding-left: 18px; }
  .ka-search input { font-size: 16.5px; }
  .ka-search .pill { min-height: 48px; padding: 0 18px; }
  .ka-closing-actions .pill { width: 100%; }
  .ka-closing-keys { gap: 10px; }
  .ka-closing { border-radius: 24px; }
  .ka-closing-keys .ka-key { --s: 50px; }
}
@media (max-width: 420px) {
  .ka-search .pill span { display: none; }
  .ka-search .pill { width: 48px; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ka-reel-track, .ka-ribbon .ka-key, .ka-skill-key { animation: none; }
  .ka-ribbon ul { transition: none; }
}
