/* The Quiet Engine showcase player. Sits on a dark ground inside a case study page. */

.qe-showcase {
  --qe-ground: #10100F;
  --qe-paper: #F2EDE6;
  --qe-navy: #0C1A2E;
  --qe-orange: #FF4E27;
  --qe-grey: #938A82;
  --qe-coral: #D8654E;
  display: block;
  background: var(--qe-ground);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
}
.qe-showcase a { color: var(--qe-orange); }
.qe-showcase a:hover { color: #ff6b49; }

.qe-panel {
  padding: clamp(16px, 2.6vw, 32px);
}

.qe-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1440 / 900;
  border: 1px solid rgba(255, 255, 255, .12);
  background: var(--qe-ground);
}
.qe-compact .qe-frame {
  width: min(100%, 352px);
  aspect-ratio: 414 / 896;
  border-radius: 12px;
  margin: 0 auto;
}

.qe-iframe {
  position: absolute;
  left: 0;
  top: 0;
  border: 0;
  display: block;
  transform-origin: 0 0;
  pointer-events: none;
  background: #f3eee6;
}

.qe-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.qe-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  will-change: transform;
}
.qe-cursor svg {
  display: block;
  transition: transform .12s ease;
  transform-origin: 4px 4px;
}
.qe-cursor.down svg { transform: scale(.85); }

.qe-touch {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  border: 1px solid var(--qe-paper);
  opacity: 0;
  transform: scale(1);
  transition: opacity .22s ease, transform .13s ease;
  will-change: transform, opacity;
}
.qe-touch.on { opacity: 1; }
.qe-touch.down { transform: scale(.765); }

.qe-ring {
  position: absolute;
  z-index: 3;
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border: 2px solid var(--qe-coral);
  border-radius: 50%;
  transform: scale(.24);
  opacity: .9;
  animation: qe-ring .45s cubic-bezier(.2, .6, .3, 1) forwards;
  will-change: transform, opacity;
}
.qe-ring.qe-ring-touch {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  transform: scale(.41);
}
@keyframes qe-ring {
  to { transform: scale(1); opacity: 0; }
}

.qe-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}
.qe-btn {
  border: 0;
  border-radius: 2px;
  background: var(--qe-paper);
  color: var(--qe-navy);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 9px 14px;
  cursor: pointer;
}
.qe-btn:hover { background: #ffffff; }
.qe-btn + .qe-btn { margin-left: -6px; }

.qe-track {
  position: relative;
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, .18);
  overflow: hidden;
}
.qe-fill {
  position: absolute;
  inset: 0;
  background: var(--qe-orange);
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}

.qe-time {
  font-size: 11px;
  font-weight: 500;
  color: var(--qe-grey);
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.qe-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  color: var(--qe-grey);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 480px) {
  .qe-controls { gap: 10px; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .qe-ring { animation: none; opacity: 0; }
  .qe-touch, .qe-cursor svg { transition: none; }
}
