/* --- demos page (wheel-first) ------------------------------------------- */

.demos-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.demos-page main.demos-stage {
  position: relative;
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: calc(100vh - 140px);
  overflow: hidden;
}

.demos-page .nav a[aria-current='page'] {
  color: var(--text);
}

.demos-idle {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
  transition: opacity 0.25s ease;
}

.demos-idle.dim {
  opacity: 0;
  pointer-events: none;
}

.demos-prompt {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.8px;
  color: #fff;
  margin: 0;
}

.demos-prompt kbd {
  font-family: Consolas, 'SF Mono', monospace;
  font-size: 0.72em;
  background: #26262b;
  border: 1px solid var(--border);
  border-bottom-width: 3px;
  border-radius: 8px;
  padding: 4px 14px;
  color: #fff;
  margin: 0 4px;
}

.demos-hint {
  color: var(--faint);
  font-size: 14.5px;
  max-width: 360px;
  margin: 0;
  line-height: 1.45;
}

.demos-hold-btn {
  margin-top: 18px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.demos-hold-btn:hover,
.demos-hold-btn:active,
.demos-hold-btn.holding {
  background: #232327;
  border-color: #3a3a42;
}

.demos-hold-btn.holding {
  transform: scale(0.97);
  border-color: #0a84ff;
  color: #fff;
}

/* --- wheel -------------------------------------------------------------- */

.demos-wheel {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: radial-gradient(circle 280px at var(--wx, 50%) var(--wy, 50%), rgba(0, 0, 0, 0.35), transparent 70%);
}

.demos-wheel[hidden],
.demos-play[hidden] {
  display: none !important;
}

.demos-wheel-center {
  position: absolute;
  left: var(--wx, 50%);
  top: var(--wy, 50%);
  transform: translate(-50%, -50%);
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #1c1c1e;
  border: 1.5px solid color-mix(in srgb, #ffab00 50%, transparent);
  color: #ffab00;
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 2;
}

.demos-wheel-btn {
  position: absolute;
  left: var(--wx, 50%);
  top: var(--wy, 50%);
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: #1c1c1e;
  border: 1px solid #3a3a40;
  color: #a1a1aa;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  transform: translate(var(--tx, 0), var(--ty, 0)) scale(1);
  transition: transform 0.08s ease, background 0.08s ease, color 0.08s ease, border-color 0.08s ease;
  padding: 0;
  z-index: 1;
}

.demos-wheel-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.demos-wheel-btn.hovered {
  background: #ffab00;
  color: #1c1c1e;
  border-color: #ffab00;
  transform: translate(var(--tx, 0), var(--ty, 0)) scale(1.18);
  z-index: 3;
}

/* --- play stage --------------------------------------------------------- */

.demos-play {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 20px 24px 28px;
}

.demos-play-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 720px;
  width: 100%;
  margin: 0 auto 16px;
}

.demos-play-bar span {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.demos-skip {
  font: inherit;
  font-size: 12px;
  color: var(--faint);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
}

.demos-skip:hover {
  color: var(--text);
  border-color: #3a3a42;
}

.demos-play-frame {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.demos-win {
  width: min(640px, 100%);
  background: #141416;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.demos-win-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding-left: 14px;
  background: #1a1a1e;
  border-bottom: 1px solid var(--border);
}

.demos-win-name {
  font-size: 12px;
  color: var(--faint);
}

.demos-win-body {
  position: relative;
  height: 340px;
  background: linear-gradient(180deg, #121214 0%, #0c0c0e 100%);
  overflow: hidden;
}

.demos-footer {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px 28px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* --- shared fake UI inside demos ---------------------------------------- */

.demo-ui-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 28px 24px;
  opacity: 0.55;
}

.demo-ui-grid span {
  height: 28px;
  border-radius: 4px;
  background: #1c1c20;
  border: 1px solid #26262b;
}

.demo-ui-grid span.hl {
  background: color-mix(in srgb, #ffd60a 18%, #1c1c20);
  border-color: color-mix(in srgb, #ffd60a 35%, #26262b);
}

.demo-ui-text {
  padding: 36px 32px;
  color: #c8c8d0;
  font-size: 15px;
  line-height: 1.55;
  max-width: 420px;
}

.demo-ui-text .line {
  display: block;
  margin-bottom: 8px;
}

.demo-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* arrow */
.demo-arrow-svg {
  position: absolute;
  overflow: visible;
}

.demo-arrow-svg path {
  fill: none;
  stroke: #ff453a;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}

.demo-arrow-svg.on path {
  stroke-dashoffset: 0;
}

.demo-arrow-svg .head {
  stroke-dasharray: none;
  opacity: 0;
  transition: opacity 0.2s ease 0.55s;
}

.demo-arrow-svg.on .head {
  opacity: 1;
}

/* rect box */
.demo-box {
  position: absolute;
  border: 2.5px solid #0a84ff;
  border-radius: 6px;
  box-sizing: border-box;
  transform: scale(0.2);
  opacity: 0;
  transform-origin: top left;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.demo-box.on {
  transform: scale(1);
  opacity: 1;
}

/* highlighter */
.demo-highlight {
  position: absolute;
  background: #ffd60a;
  opacity: 0;
  border-radius: 3px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.55s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.2s ease;
}

.demo-highlight.on {
  opacity: 0.45;
  transform: scaleX(1);
}

/* numbered markers */
.demo-marker {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ff453a;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-marker.on {
  opacity: 1;
  transform: scale(1);
}

.demo-marker.m2 { background: #0a84ff; }
.demo-marker.m3 { background: #ffd60a; color: #1c1c1e; }

/* sticky note */
.demo-note {
  position: absolute;
  width: 140px;
  min-height: 90px;
  background: #ffe566;
  color: #1c1c1e;
  border-radius: 2px 2px 2px 0;
  padding: 12px 12px 16px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(12px) rotate(-2deg);
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-note.on {
  opacity: 1;
  transform: translateY(0) rotate(-2deg);
}

/* screenshot marquee */
.demo-marquee {
  position: absolute;
  border: 2px dashed #fff;
  background: rgba(10, 132, 255, 0.12);
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.demo-marquee.on {
  opacity: 1;
}

.demo-shot {
  position: absolute;
  border: 2px solid #0a84ff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-shot.on {
  opacity: 1;
  transform: scale(1);
}

.demo-shot-inner {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, #1a3a5c 0%, #0a84ff 40%, #1c1c20 100%);
}

/* clipboard mini (inside demos canvas) */
.demo-clip-hotkey {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%) translateY(8px);
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.demo-clip-hotkey.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.demo-clip-hotkey kbd {
  font-family: Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  background: #2a2a30;
  border: 1px solid #3a3a42;
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 5px 9px;
  color: #fff;
}

.demo-clip-picker {
  position: absolute;
  left: 52%;
  top: 38%;
  width: 280px;
  background: #1c1c1e;
  border: 1px solid #3a3a40;
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  opacity: 0;
  transform: scale(0.92) translateY(6px);
  transform-origin: top left;
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-clip-picker.on {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.demo-clip-picker .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  border-bottom: 1px solid #2a2a30;
}

.demo-clip-picker .head .muted { color: var(--faint); font-weight: 500; }

.demo-clip-tabs {
  display: flex;
  gap: 2px;
  background: #26262b;
  border-radius: 5px;
  padding: 2px;
}

.demo-clip-tab {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--faint);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.demo-clip-tab.on {
  background: #1c1c1e;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.demo-clip-count {
  font-size: 9px;
  font-weight: 700;
  background: #0a84ff;
  color: #fff;
  border-radius: 999px;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  display: inline-grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.demo-clip-count.on {
  opacity: 1;
  transform: scale(1);
}

.demo-clip-list.hidden { display: none; }

.demo-clip-row {
  display: grid;
  grid-template-columns: 18px 1fr auto 14px;
  gap: 7px;
  align-items: center;
  padding: 6px 8px;
  margin: 2px 3px;
  border-radius: 5px;
  font-size: 11px;
}

.demo-clip-row .star {
  font-size: 11px;
  color: var(--faint);
  text-align: center;
  transition: color 0.2s ease, transform 0.2s ease;
}

.demo-clip-row .star.on {
  color: #ffd60a;
  transform: scale(1.15);
}

.demo-clip-row.starring .star {
  color: #ffd60a;
  transform: scale(1.35);
}

.demo-clip-row.active {
  background: color-mix(in srgb, #0a84ff 22%, transparent);
}

.demo-clip-row.picked {
  background: color-mix(in srgb, #30d158 28%, transparent);
}

.demo-clip-toast {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(8px);
  background: #1c1c1e;
  border: 1px solid #3a3a40;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 11.5px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
}

.demo-clip-toast.on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  .demos-win-body { height: 280px; }
  .demo-clip-picker { width: 240px; left: 40%; }
  .demos-footer { flex-wrap: wrap; }
}
