/* Papaduck STS3215 site chrome. */

:root {
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bg: #fff;
  --ink: #0a0a0a;
  --ink-2: #6b6b70;
  --ink-3: #a1a1a8;
  --field: #f4f4f5;
  --field-hover: #ededee;
  --accent: #ff5a1f;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 0.13s;
  --dur-base: 0.22s;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, #ffffff 0%, #f4f4f5 70%, #ececee 100%);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

.stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
  margin: 0;
}

.stage__brand {
  align-items: baseline;
  display: flex;
  gap: 7px;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 16px;
  transform: translateX(-50%);
  z-index: 2;
}
.stage__brand strong {
  font-size: 14px;
  letter-spacing: -0.02em;
}
.stage__brand span {
  color: var(--ink-3);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.stage canvas {
  cursor: grab;
  touch-action: none;
}
.stage canvas:active {
  cursor: grabbing;
}

/* loading */
.stage__loading {
  transition: opacity var(--dur-base) var(--ease-out);
  place-items: center;
  display: grid;
  position: absolute;
  inset: 0;
}
.stage__loading[hidden] {
  display: none;
}
.stage__loading span {
  display: block;
}

.spinner {
  border: 2px solid #e6e6e8;
  border-top-color: var(--ink-3);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 10px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.visually-hidden {
  clip-path: inset(50%);
  white-space: nowrap;
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
}

/* part readout pill */
.stage__part {
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #e6e6e8;
  border-radius: 999px;
  padding: 4px 14px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  font-size: 12px;
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  backdrop-filter: blur(6px);
}
.stage__part[hidden] {
  display: none;
}

/* viewer controls (top right) */
.stage__controls {
  align-items: center;
  display: flex;
  gap: 8px;
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}
.stage__controls button {
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #e6e6e8;
  border-radius: 8px;
  box-sizing: border-box;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  padding: 6px 12px;
  backdrop-filter: blur(6px);
  transition:
    color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    opacity var(--dur-fast) var(--ease-out);
}
.stage__controls button:hover {
  color: var(--ink);
  background: var(--field);
}
.stage__controls button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.stage__controls button:disabled {
  cursor: wait;
  opacity: 0.55;
}
.stage__walk {
  min-width: 83px;
}
.stage__pause {
  min-width: 70px;
}
.stage__walk-modes {
  display: flex;
}
.stage__walk-modes button {
  border-radius: 0;
  margin-left: -1px;
  padding-inline: 10px;
}
.stage__walk-modes button:first-child {
  border-radius: 8px 0 0 8px;
  margin-left: 0;
}
.stage__walk-modes button:last-child {
  border-radius: 0 8px 8px 0;
}
.stage__walk-modes button[aria-pressed="true"] {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
  position: relative;
}
.stage__walk-modes button[aria-pressed="true"]:hover {
  color: #fff;
  background: var(--ink);
}
/* persistent canvas instructions */
.stage__instructions {
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(230, 230, 232, 0.95);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
  padding: 12px 14px;
  position: absolute;
  top: 14px;
  left: 14px;
  width: min(274px, calc(100vw - 28px));
  pointer-events: none;
  backdrop-filter: blur(12px);
}
.stage__instructions-title {
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.2;
  margin: 0 0 9px;
  text-transform: uppercase;
}
.stage__instructions ul {
  display: grid;
  gap: 5px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.stage__instructions li {
  align-items: baseline;
  display: grid;
  gap: 8px;
  grid-template-columns: max-content 1fr;
  line-height: 1.25;
}
.stage__instructions kbd {
  background: var(--field);
  border: 1px solid #e5e5e7;
  border-radius: 4px;
  color: var(--ink-2);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  white-space: nowrap;
}
.stage__instructions li span {
  font-size: 11px;
}

@media (max-width: 560px) {
  .stage__brand {
    bottom: 14px;
    left: auto;
    right: 14px;
    top: auto;
    transform: none;
  }
  .stage__controls {
    gap: 6px;
    left: 14px;
    right: auto;
  }
  .stage__controls button {
    font-size: 11px;
    padding: 6px 9px;
  }
  .stage__instructions {
    top: 72px;
    padding: 10px 11px;
    width: 226px;
  }
  .stage__instructions ul {
    gap: 4px;
  }
  .stage__instructions li {
    gap: 6px;
  }
  .stage__instructions kbd,
  .stage__instructions li span {
    font-size: 9px;
  }
}

.stage__fallback {
  text-align: center;
  color: var(--ink-2);
  place-content: center;
  padding: 24px;
  font-size: 14px;
  display: grid;
  position: absolute;
  inset: 0;
}
.stage__fallback-cmd {
  background: var(--field);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
}
