/* demo */

.demo {
  width: 64vw;

  margin:
    clamp(40px, 5.3vh, 60px)
    auto
    0;
}

.demo-stage {
  position: relative;

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.4vw, 18px);

  padding: clamp(14px, 1.6vw, 20px);

  border: 1px solid var(--border);
  border-radius: 5px;

  background: #0b0b0b;

  overflow: hidden;
}

.demo-window {
  min-width: 0;
  min-height: 360px;

  border: 1px solid #292929;
  border-radius: 4px;

  background: #111;

  overflow: hidden;

  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.22);
}

.demo-titlebar {
  min-height: 34px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  padding: 0 11px;

  border-bottom: 1px solid #292929;

  background: #191919;

  color: #aaa;

  font-size: 9px;
}

.demo-window-controls {
  color: #666;
  letter-spacing: 0.18em;
  white-space: nowrap;
}

/* explorer */

.demo-explorer-window {
  position: relative;

  display: flex;
  flex-direction: column;
}

.demo-explorer-toolbar {
  min-height: 36px;

  display: flex;
  align-items: center;
  gap: 9px;

  padding: 0 10px;

  border-bottom: 1px solid #292929;

  background: #151515;

  color: #707070;

  font-size: 9px;
}

.demo-path {
  min-width: 0;
  flex: 1;

  padding: 5px 8px;

  border: 1px solid #292929;
  border-radius: 2px;

  background: #101010;

  color: #999;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.demo-explorer-commands {
  min-height: 34px;

  display: flex;
  align-items: center;
  gap: 18px;

  padding: 0 12px;

  border-bottom: 1px solid #292929;

  background: #131313;

  color: #555;

  font-family:
    "Segoe UI",
    system-ui,
    sans-serif;

  font-size: 9px;
}

.demo-rename-command {
  transition:
    color 133ms ease,
    background 133ms ease;
}

.demo-explorer-window.demo-has-selection
.demo-rename-command {
  color: #c7c7c7;
}

.demo-rename-command.demo-pressed {
  color: #fff;
}

.demo-explorer-body {
  flex: 1;

  padding: 8px 9px 14px;
}

.demo-explorer-head {
  height: 28px;

  display: flex;
  align-items: center;

  padding: 0 9px;

  border-bottom: 1px solid #292929;

  color: #777;

  font-size: 9px;
}

.demo-folder-list {
  position: relative;
}

.demo-folder {
  min-height: 48px;

  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 9px;

  padding: 0 9px;

  border-bottom: 1px solid #202020;

  color: #cfcfcf;

  font-family:
    "Segoe UI",
    system-ui,
    sans-serif;

  font-size: 11px;

  transition:
    background 150ms ease,
    transform 367ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.demo-folder.demo-selected {
  background: #202020;
}

.demo-folder.demo-pressed {
  background: #272727;
}

.demo-folder-icon {
  position: relative;

  width: 16px;
  height: 12px;

  border-radius: 2px;

  background: #c8a246;
}

.demo-folder-icon::before {
  content: "";

  position: absolute;
  top: -3px;
  left: 1px;

  width: 7px;
  height: 4px;

  border-radius: 2px 2px 0 0;

  background: #d3ae55;
}

.demo-folder-name {
  position: relative;

  width: fit-content;

  padding: 2px 4px;

  border: 1px solid transparent;
}

.demo-folder.demo-renaming .demo-folder-name {
  min-width: 76px;

  border-color: #6d8fb3;
  background: #151b22;
}

.demo-folder.demo-caret-start .demo-folder-name::before {
  content: "";

  position: absolute;
  top: 3px;
  left: 2px;

  width: 1px;
  height: 14px;

  background: #f2f2f2;
}

.demo-shortcut-overlay {
  position: absolute;
  inset: 0;

  z-index: 10;

  display: grid;
  place-items: center;

  background: rgba(10, 10, 10, 0.12);

  color: #fff;

  font-family: var(--mono);
  font-size: clamp(20px, 1.7vw, 28px);
  font-weight: 700;
  letter-spacing: -0.04em;

  text-shadow: 0 2px 12px #000;

  opacity: 0;
  transform: scale(0.96);

  pointer-events: none;

  transition:
    opacity 117ms ease,
    transform 117ms ease;
}

.demo-shortcut-overlay.demo-visible {
  opacity: 1;
  transform: scale(1);
}

/* browser / mini GhostSort */

.demo-browser-bar {
  min-height: 38px;

  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;

  padding: 0 10px;

  border-bottom: 1px solid #292929;

  background: #191919;

  color: #666;

  font-size: 9px;
}

.demo-browser-nav {
  white-space: nowrap;
  letter-spacing: 0.08em;
}

.demo-browser-address {
  min-width: 0;

  padding: 5px 8px;

  border: 1px solid #292929;
  border-radius: 3px;

  background: #111;

  color: #777;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.demo-ghostsort-body {
  min-height: 321px;

  display: flex;
  flex-direction: column;

  padding: 14px 16px 16px;
}

.demo-site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  color: #777;

  font-size: 8px;
}

.demo-brand {
  color: #d7d7d7;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.demo-brand span {
  color: var(--accent);
}

.demo-site-source {
  color: #666;
}

.demo-site-hero {
  margin: 24px 0 22px;

  text-align: center;
}

.demo-site-hero strong {
  display: block;

  color: #e0e0e0;

  font-size: clamp(13px, 1vw, 17px);
  line-height: 1.08;
  letter-spacing: -0.055em;
  font-weight: 600;
}

.demo-site-hero span {
  display: block;

  margin-top: 7px;

  color: #666;

  font-size: 7px;
}

.demo-field-label {
  display: block;

  margin-bottom: 6px;

  color: #777;

  font-size: 9px;
}

.demo-fake-input,
.demo-fake-button {
  min-height: 32px;

  display: flex;
  align-items: center;

  padding: 0 10px;

  border: 1px solid #292929;
  border-radius: 3px;

  background: #101010;

  color: #ddd;

  font-size: 9px;
}

.demo-fake-input {
  position: relative;
}

.demo-fake-button {
  justify-content: center;

  margin-top: 6px;

  color: #cfcfcf;
}

.demo-fake-button.demo-pressed {
  background: #171717;
  border-color: #444;
}

.demo-caret {
  width: 1px;
  height: 13px;

  margin-left: 2px;

  background: #999;

  opacity: 0;
}

.demo-fake-input.demo-focused .demo-caret {
  opacity: 1;
  animation: demo-caret 667ms steps(1) infinite;
}

.demo-prefixes {
  margin-top: 12px;

  border-top: 1px solid #252525;

  opacity: 0;
  transform: translateY(5px);

  pointer-events: none;

  transition:
    opacity 183ms ease,
    transform 183ms ease;
}

.demo-prefixes.demo-visible {
  opacity: 1;
  transform: translateY(0);
}

.demo-prefix-row {
  min-height: 29px;

  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;

  padding: 0 6px;

  border-bottom: 1px solid #252525;

  color: #bababa;

  font-size: 8px;
}

.demo-prefix-row span:first-child {
  color: #737373;
}

.demo-prefix-row span:last-child {
  color: #777;
}

.demo-prefix-row.demo-copied span:first-child,
.demo-prefix-row.demo-copied span:nth-child(2) {
  color: #444;
}

.demo-prefix-row.demo-copied span:last-child {
  color: var(--accent);
}

.demo-prefix-row.demo-pressed {
  background: #171717;
}

/* cursor */

.demo-cursor {
  position: absolute;
  top: 0;
  left: 0;

  z-index: 20;

  width: 15px;
  height: 19px;

  background: #e5e5e5;

  clip-path: polygon(
    0 0,
    0 100%,
    29% 72%,
    46% 100%,
    59% 93%,
    43% 66%,
    80% 66%
  );

  filter:
    drop-shadow(0 1px 0 #000)
    drop-shadow(0 0 2px #000);

  opacity: 0;

  transform: translate3d(0, 0, 0);

  transition:
    transform 633ms cubic-bezier(0.2, 0.75, 0.25, 1),
    opacity 83ms ease;
}

.demo-cursor.demo-visible {
  opacity: 1;
}

.demo-cursor.demo-clicking {
  opacity: 0.72;
}

@keyframes demo-caret {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .demo {
    width: 86vw;
  }
}

@media (max-width: 600px) {
  .demo {
    width: 100%;

    margin-top: 34px;
  }

  .demo-stage {
    grid-template-columns: 1fr;

    gap: 12px;

    padding: 10px;
  }

  .demo-window {
    min-height: 330px;
  }

  .demo-titlebar {
    min-height: 32px;
  }

  .demo-explorer-commands {
    gap: 14px;
  }

  .demo-ghostsort-body {
    min-height: 292px;

    padding: 13px;
  }

  .demo-site-hero {
    margin: 20px 0;
  }

  .demo-site-hero strong {
    font-size: 15px;
  }

  .demo-prefix-row {
    min-height: 28px;
  }

  .demo-folder {
    min-height: 44px;
  }

  .demo-shortcut-overlay {
    font-size: 24px;
  }
}

@media (max-width: 360px) {
  .demo-explorer-toolbar,
  .demo-explorer-commands,
  .demo-browser-bar {
    font-size: 8px;
  }

  .demo-prefix-row {
    font-size: 7px;
  }
}

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

  .demo-cursor {
    display: none;
  }

  .demo-prefixes {
    opacity: 1;
    transform: none;
  }

  .demo-folder {
    transition: none;
  }
}
