/* ==== Copied from src/DraftFinder/css/style.css: the miniature window, keycap,
   toast, caret and palette (the DraftFinder-specific demos are left out). ==== */
.feature-demo {
  position: relative;
  container-type: inline-size;
  margin-bottom: 1.75rem;
}

.demo-win {
  display: grid;
  grid-template-columns: 22% minmax(0, 1fr);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  font: 400 3.1cqw/1.3 system-ui, -apple-system, "Hiragino Sans", sans-serif;
  color: var(--text-dark);
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 0.6em;
}

/* Sidebar: window controls + vertical tabs (the app has no title bar). */
.demo-side {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  min-width: 0;
  padding: 0.8em 0.5em;
  background: var(--bg-gray);
  border-right: 1px solid var(--border-color);
}

.demo-lights {
  display: flex;
  gap: 0.3em;
  margin-bottom: 0.5em;
}

.demo-lights i {
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--border-color);
}

.demo-tab {
  overflow: hidden;
  padding: 0.25em 0.45em;
  border-radius: 0.35em;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.demo-tab.is-active {
  color: var(--text-dark);
  background: var(--bg-light);
  box-shadow: 0 0 0 1px var(--border-color);
}

.demo-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.demo-body {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
}

.demo-list {
  --row: 2.1em;
  --cursor-row: 0;
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 0.6em 0;
}

.demo-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.45em;
  height: var(--row);
  padding: 0 0.75em;
  white-space: nowrap;
}

.demo-row span:last-child {
  margin-left: auto;
  color: var(--text-muted);
}

/* File-type chip standing in for the Nerd Font icons the app draws. */
.demo-ico {
  flex: none;
  width: 0.85em;
  height: 0.7em;
  border-radius: 0.15em;
  background: var(--border-color);
}

.demo-ico--folder { background: color-mix(in srgb, var(--primary-blue) 45%, white); }
.demo-ico--image  { background: color-mix(in srgb, var(--secondary-yellow) 70%, white); }
.demo-ico--pdf    { background: color-mix(in srgb, var(--secondary-red) 55%, white); }

.demo-cursor {
  position: absolute;
  top: calc(0.6em + var(--cursor-row) * var(--row));
  right: 0.3em;
  left: 0.3em;
  height: var(--row);
  border-radius: 0.35em;
  background: color-mix(in srgb, var(--primary-blue) 16%, transparent);
}

.demo-addr {
  overflow: hidden;
  padding: 0.45em 0.75em;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  border-top: 1px solid var(--border-color);
}

/* The keycap. Sits on the window's bottom-right edge like a key on a desk. */
.demo-key {
  position: absolute;
  right: 4%;
  bottom: -4cqw;
  z-index: 3;
  display: grid;
  place-items: center;
  min-width: 10cqw;
  height: 10cqw;
  padding: 0 2.4cqw;
  font: 600 4.6cqw/1 system-ui, -apple-system, sans-serif;
  color: var(--text-dark);
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 2cqw;
  box-shadow: 0 1cqw 0 var(--border-color), 0 1.6cqw 3cqw rgb(0 0 0 / 0.12);
}

.demo-toast {
  position: absolute;
  bottom: 0.7em;
  left: 50%;
  z-index: 2;
  padding: 0.35em 0.9em;
  white-space: nowrap;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  box-shadow: 0 0.2em 0.6em rgb(0 0 0 / 0.1);
  transform: translateX(-50%);
}
.demo-win { position: relative; }
.demo-caret {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 0.2em;
  vertical-align: -0.15em;
  background: var(--bg-gray);
  animation: df-caret 1s steps(2, jump-none) infinite;
}

@keyframes df-caret {
  from { opacity: 1; }
  to   { opacity: 0; }
}
/* ---- Command palette (⌘K) ------------------------------------------------ */

.demo-pal {
  position: absolute;
  top: 10%;
  left: 50%;
  z-index: 2;
  width: 66%;
  overflow: hidden;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 0.6em;
  box-shadow: 0 0.5em 1.4em rgb(0 0 0 / 0.14);
  transform: translateX(-50%);
}

.demo-pal-input {
  display: grid;
  padding: 0.5em 0.75em;
  border-bottom: 1px solid var(--border-color);
}

.demo-pal-input > span { grid-area: 1 / 1; }

.demo-pal-ph {
  color: var(--text-muted);
  opacity: 0;
}

.demo-pal-item {
  display: flex;
  align-items: center;
  height: 1.9em;
  padding: 0 0.75em;
}

.demo-pal-item:first-child {
  background: color-mix(in srgb, var(--primary-blue) 16%, transparent);
}

.demo-pal-item kbd {
  margin-left: auto;
  font: inherit;
  color: var(--text-muted);
}

/* 7.5s: ⌘K opens the palette and "sort" narrows it to the sort commands. */
.demo--pal .demo-pal  { animation: df-pal 7.5s ease-out infinite; }
.demo--pal .demo-pal-ph { animation: df-pal-ph 7.5s linear infinite; }
.demo--pal .demo-pal-q i { font-style: normal; animation: df-pal-letter 7.5s linear infinite; }
.demo--pal .demo-pal-q i:nth-child(2) { animation-delay: 0.3s; }
.demo--pal .demo-pal-q i:nth-child(3) { animation-delay: 0.6s; }
.demo--pal .demo-pal-q i:nth-child(4) { animation-delay: 0.9s; }
.demo--pal .demo-pal-list { animation: df-pal-list 7.5s linear infinite; }
.demo--pal .demo-key  { animation: df-pal-key 7.5s linear infinite; }

@keyframes df-pal {
  0%, 12%   { opacity: 0; transform: translate(-50%, -0.5em); }
  16%, 78%  { opacity: 1; transform: translateX(-50%); }
  84%, 100% { opacity: 0; transform: translateX(-50%); }
}

@keyframes df-pal-ph {
  0%, 24%   { opacity: 1; }
  25%, 100% { opacity: 0; }
}

@keyframes df-pal-letter {
  0%, 24%   { opacity: 0; }
  25%, 84%  { opacity: 1; }
  88%, 100% { opacity: 0; }
}

@keyframes df-pal-list {
  0%, 24%   { opacity: 0; }
  25%, 100% { opacity: 1; }
}

@keyframes df-pal-key {
  0%, 9.9%, 13.1%, 100% {
    color: var(--text-dark);
    background: var(--bg-light);
    border-color: var(--border-color);
    box-shadow: 0 1cqw 0 var(--border-color), 0 1.6cqw 3cqw rgb(0 0 0 / 0.12);
    transform: none;
  }
  10%, 13% {
    color: var(--bg-light);
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    box-shadow: 0 0.2cqw 0 var(--primary-dark), 0 0.4cqw 1cqw rgb(0 0 0 / 0.12);
    transform: translateY(0.8cqw);
  }
}
@media (prefers-reduced-motion: reduce) {
  .feature-demo *,
  .feature-demo *::before {
    animation: none !important;
  }
}

