/* Flat shapes and a shared layout for the short, local tool demonstrations. */
.yk-home-hero > .yk-home-art {
  --art-paper: #f9fbff;
  --art-line: #a5b3d7;
  --art-sky: #dae5ff;
  --art-blue: #7895eb;
  --art-jade: #8acbc1;
  --art-gold: #f6be7e;
  position: absolute;
  z-index: 0;
  top: 61px;
  width: 170px;
  height: 150px;
  pointer-events: none;
}

html[data-theme="dark"] .yk-home-hero > .yk-home-art {
  --art-paper: #202e49;
  --art-line: #6379ac;
  --art-sky: #354d82;
  --art-blue: #829df3;
  --art-jade: #78c3b6;
  --art-gold: #fac689;
}

.yk-home-art--image { left: clamp(14px, 4vw, 60px); }
.yk-home-art--code { right: clamp(14px, 4vw, 60px); }
.yk-home-art > span { position: absolute; display: block; }
.yk-art-orbit {
  inset: 18px 0 8px;
  border: 1px dashed var(--art-line);
  border-radius: 48%;
  transform: rotate(-24deg);
  opacity: .62;
}
.yk-home-art--code .yk-art-orbit { transform: rotate(24deg); }

.yk-art-photo-back,
.yk-art-photo {
  width: 109px;
  height: 80px;
  border: 1.5px solid var(--art-line);
  border-radius: 14px;
  background: var(--art-paper);
}
.yk-art-photo-back { left: 18px; top: 34px; transform: rotate(-15deg); }
.yk-art-photo { left: 34px; top: 34px; padding: 7px; transform: rotate(7deg); }
.yk-art-photo i {
  position: relative;
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: radial-gradient(circle at 74% 29%, var(--art-gold) 0 8px, transparent 8.5px), var(--art-sky);
}
.yk-art-photo i::before,
.yk-art-photo i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--art-blue);
  clip-path: polygon(0 83%, 34% 33%, 75% 100%, 0 100%);
}
.yk-art-photo i::after {
  background: var(--art-jade);
  clip-path: polygon(20% 100%, 66% 52%, 100% 78%, 100% 100%);
}

.yk-art-crop,
.yk-art-return {
  display: grid !important;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--art-line);
  border-radius: 13px;
  background: var(--art-paper);
  color: var(--yk-primary);
}
.yk-art-crop { right: 4px; bottom: 13px; transform: rotate(10deg); }
.yk-art-crop i { position: relative; width: 23px; height: 23px; }
.yk-art-crop i::before,
.yk-art-crop i::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border: 1.6px solid currentColor;
}
.yk-art-crop i::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.yk-art-crop i::after { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.yk-art-spark { left: 12px; top: 8px; color: var(--art-gold); font-size: 23px; }
.yk-home-art--code .yk-art-spark { left: auto; right: 6px; top: 3px; color: var(--yk-accent); }

.yk-art-code-card {
  top: 26px;
  right: 18px;
  width: 121px;
  height: 89px;
  padding: 27px 13px 8px;
  border: 1.5px solid var(--art-line);
  border-radius: 14px;
  background: var(--art-paper);
  transform: rotate(9deg);
  text-align: left;
}
.yk-art-code-card::before {
  content: "";
  position: absolute;
  inset: 8px 12px auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--art-gold);
  box-shadow: 8px 0 var(--art-jade), 16px 0 var(--art-blue);
}
.yk-art-code-card i { display: block; width: 44px; height: 4px; margin-bottom: 7px; border-radius: 5px; background: var(--art-blue); }
.yk-art-code-card i:nth-child(2) { width: 29px; margin-left: 8px; background: var(--art-jade); }
.yk-art-code-card i:nth-child(3) { width: 38px; background: var(--art-line); }
.yk-art-code-card b { position: absolute; right: 11px; bottom: 8px; color: var(--yk-accent); font: 700 19px/1 monospace; }
.yk-art-return { left: 9px; bottom: 10px; transform: rotate(-12deg); font: 700 24px/1 monospace; }

.yk-home-hero .yk-home-art { animation: yk-art-arrive 550ms var(--yk-ease) both; }
.yk-home-hero .yk-home-art--code { animation-delay: 80ms; }
@keyframes yk-art-arrive {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.yk-home-counts {
  min-height: 26px;
  margin-top: 8px;
  color: var(--yk-muted);
  font-size: 12px;
}
.yk-home-hero.is-searching > :is(.yk-home-art, .yk-home-counts) { display: none; }
.yk-count-pair { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 18px; }
.yk-count-pair > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.yk-count-pair > span + span::before { content: ""; width: 1px; height: 12px; margin-right: 10px; background: var(--yk-line-strong); }
.yk-count-pair strong { display: inline-flex; align-items: center; min-height: 1.16em; color: var(--yk-ink); font-size: 14px; font-weight: 780; font-variant-numeric: tabular-nums; line-height: 1.16; }
.yk-count-window { display: inline-block; overflow: hidden; width: .64em; height: 1.16em; text-align: center; }
.yk-count-track {
  display: block;
  transform: translateY(calc(-1.16em * var(--count-steps)));
  animation: yk-count-roll 880ms cubic-bezier(.16,.75,.21,1) both;
  animation-delay: var(--count-delay, 0ms);
}
.yk-count-track > span { display: block; height: 1.16em; }
@keyframes yk-count-roll {
  from { transform: translateY(0); }
  to { transform: translateY(calc(-1.16em * var(--count-steps))); }
}
.yk-count-error, .yk-home-counts[data-state="unavailable"] .yk-count-pair { display: none; }
.yk-home-counts[data-state="unavailable"] .yk-count-error { display: inline; }

.yk-hero.yk-demo-hero.yk-demo-ready {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(256px, 335px);
  gap: 20px clamp(20px, 4vw, 56px);
  align-items: center;
  padding-block: clamp(18px, 2.2vw, 28px);
}
.yk-demo-copy { position: relative; min-width: 0; }
.yk-demo-copy h1 { text-wrap: initial; }
.yk-tool-demo {
  position: relative;
  z-index: 1;
  min-width: 0;
  margin: 0;
  padding: 6px 12px 5px;
  border: 1px solid var(--yk-line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--yk-surface) 90%, var(--yk-primary-soft));
}
.yk-tool-demo canvas { display: block; width: 100%; height: auto; aspect-ratio: 320 / 86; }
.yk-tool-demo figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 33px;
  padding: 2px 1px 0;
  border-top: 1px solid var(--yk-line);
  color: var(--yk-muted);
  font-size: 11px;
  line-height: 1.35;
}
.yk-tool-demo .yk-demo-replay {
  display: inline-grid !important;
  flex: 0 0 34px;
  place-items: center;
  width: 34px !important;
  height: 30px;
  min-height: 30px !important;
  padding: 0 !important;
  border: 1px solid var(--yk-line) !important;
  border-radius: 8px !important;
  background: var(--yk-surface-soft) !important;
  box-shadow: none !important;
  color: var(--yk-primary) !important;
  font: 600 17px/1 system-ui !important;
  cursor: pointer;
}
.yk-tool-demo .yk-demo-replay:hover { background: var(--yk-primary-soft) !important; transform: none !important; }
.yk-tool-demo .yk-demo-replay:focus-visible { outline: 2px solid var(--yk-primary); outline-offset: 2px; }

@media (max-width: 1090px) {
  .yk-home-hero > .yk-home-art { display: none; }
}
@media (max-width: 700px) {
  .yk-hero.yk-demo-hero.yk-demo-ready { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .yk-tool-demo { width: min(100%, 312px); padding: 4px 9px; }
  .yk-tool-demo figcaption { min-height: 30px; }
  .yk-home-counts { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .yk-home-hero .yk-home-art,
  .yk-count-track { animation: none !important; }
  .yk-tool-demo .yk-demo-replay { display: none !important; }
}
