/* Home page "What we do" (home.html, .kpro): the layout, the list of skills and the
   logo marquee. The skill ring beside the list has its own file, skill-ring.css. The
   marquee's logos are Simple Icons (CC0) drawn as masks, so each can be grey at rest and its
   brand colour on hover. */
.kpro {
  --kp-ink: var(--kd-ink);
  --kp-body: var(--kd-muted);
  --kp-line: var(--kd-line);
  --kp-brand: var(--kd-brand);
  --kp-brand-dark: var(--kd-brand-darker);
  --kp-mint: var(--kd-mint);
  position: relative;
}

.kpro-pattern {
  background-image: url("../images/patterns/kanidata-emblem-pattern.6c3f61967e4d.svg");
  background-size: 160px 120px;
  opacity: 0.05;
}

/* ---------- Layout: the wheel on the left, the skill list on the right ---------- */
.kpro__grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .kpro__grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 3rem;
  }
}

/* ---------- The wheel: five skills that spin into a slot ----------
   A plain diagram: one hairline ring, a thin spoke from the Kanidata emblem to every skill,
   and flat nodes with their names outside the ring. The nodes and spokes sit on a wheel that
   turns by --turn; the picked skill is the one in the slot on the right (90deg), facing the
   list. Each node turns back by its own angle --a plus --turn so it stays upright, and its
   name glides round the outside using sin()/cos() of its angle on screen. --turn is a
   registered angle, so it animates smoothly and everything stays upright on the way.
   Everything is placed from the centre (--cx, --cy) in em, set by the font size, so the
   diagram scales with the screen. */
/* ---------- The skill list ---------- */
.kpro__skills {
  display: grid;
  gap: 0.6rem;
}

/* A row shows its icon and name; the picked row opens to its line and tool names. */
.kpro-skill {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 0.85rem;
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 0.65rem;
  border: 0;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow:
    0 0 0 1px var(--kp-line),
    0 14px 28px -22px rgba(15, 23, 42, 0.5);
  color: var(--kp-ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

.kpro-skill:hover {
  transform: translateX(4px);
}

.kpro-skill__icon {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.7rem;
  background: var(--kd-brand-soft);
  color: var(--kp-brand);
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.kpro-skill__icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.kpro-skill__more {
  display: grid;
  grid-column: 2 / -1;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 0.45s cubic-bezier(0.22, 0.8, 0.25, 1),
    opacity 0.3s ease;
}

.kpro-skill__more > span {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
  overflow: hidden;
}

.kpro-skill__line {
  padding-top: 0.35rem;
  font-weight: 400;
  line-height: 1.45;
}

.kpro-skill__tools {
  padding-bottom: 0.2rem;
  color: var(--kd-mint-soft);
  font-size: 0.85rem;
  font-weight: 600;
}

.kpro-skill.is-active {
  background: var(--kd-brand);
  box-shadow:
    0 0 0 4px rgba(59, 89, 152, 0.15),
    0 18px 32px -18px rgba(34, 54, 95, 0.7);
  color: #ffffff;
}

.kpro-skill.is-active .kpro-skill__icon {
  background: var(--kp-mint);
  color: #ffffff;
}

.kpro-skill.is-active .kpro-skill__more {
  grid-template-rows: 1fr;
  opacity: 1;
}

.kpro-skill:focus-visible {
  outline: 3px solid var(--kp-brand);
  outline-offset: 3px;
}

.kpro-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  white-space: nowrap;
}

.kpro-logo i {
  -webkit-mask: var(--logo) center / contain no-repeat;
  mask: var(--logo) center / contain no-repeat;
}

/* ---------- Logo marquee: one quiet row of icons ---------- */
.kpro-marquee {
  max-width: 72rem;
  margin: 2rem auto 0;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent,
    #000 7%,
    #000 93%,
    transparent
  );
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 7%,
    #000 93%,
    transparent
  );
}

/* The top padding leaves room for the name tooltips, which the row would otherwise clip. */
.kpro-marquee__row {
  padding-top: 2.5rem;
  overflow: hidden;
}

.kpro-marquee__track {
  display: flex;
  gap: 4.5rem;
  width: max-content;
  animation: kpro-scroll 80s linear infinite;
}

.kpro-marquee__row:hover .kpro-marquee__track {
  animation-play-state: paused;
}

@keyframes kpro-scroll {
  to {
    transform: translateX(calc(-50% - 2.25rem));
  }
}

.kpro-logo {
  position: relative;
  color: var(--kd-faint);
  font-size: 1.05rem;
  transition: color 0.25s ease;
}

/* Name tooltip in the tool's own brand colour. */
.kpro-logo::before,
.kpro-logo::after {
  position: absolute;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.25rem);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.kpro-logo::after {
  content: attr(data-name);
  bottom: calc(100% + 0.55rem);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 6px 14px -6px rgba(11, 27, 58, 0.45);
  color: var(--brand-ink, #fff);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.kpro-logo::before {
  content: "";
  bottom: calc(100% + 0.2rem);
  border: 0.2rem solid transparent;
  border-top-color: var(--brand);
}

.kpro-logo:hover::before,
.kpro-logo:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.kpro-logo i {
  width: 2rem;
  height: 2rem;
  background: #b4becd;
  transition: background-color 0.25s ease;
}

.kpro-logo:hover {
  color: var(--kp-ink);
}

.kpro-logo:hover i {
  background: var(--brand);
}

/* Multi-colour logos: the grey silhouette is cut from the same artwork, so hover reveals it in full colour.
   No transition, or the grey fades out as an unmasked square. */
.kpro-logo--full i {
  transition: none;
}

.kpro-logo--full:hover i {
  -webkit-mask: none;
  mask: none;
  background: var(--logo) center / contain no-repeat;
}

/* ---------- Link to the services page, under the skill cards ---------- */
.kpro-more {
  display: inline-flex;
  gap: 0.4rem;
  margin: 1.25rem 0 0 0.25rem;
  color: var(--kd-brand);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.kpro-more span[aria-hidden] {
  transition: transform 0.2s ease;
}

.kpro-more:hover {
  color: var(--kd-brand-darker);
}

.kpro-more:hover span[aria-hidden] {
  transform: translateX(3px);
}

.kpro-more:focus-visible {
  outline: 3px solid var(--kd-brand);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .kpro-marquee__track {
    animation: none;
  }

  .kpro-skill__more {
    transition: none;
  }

  .kpro-marquee__track {
    flex-wrap: wrap;
    justify-content: center;
    width: auto;
  }

  .kpro-marquee__track [aria-hidden="true"] {
    display: none;
  }
}
