/* ===== Project demo button (on project cards) ===== */

.project-demo-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.3rem;
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--primary-color);
  background: transparent;
  border: 1.5px solid var(--primary-color);
  border-radius: 20px;
  cursor: pointer;
  transition: var(--tran-03);
}

.project-demo-btn i {
  font-size: 1rem;
}

.project-demo-btn:hover {
  background: var(--primary-color);
  color: #fff;
}

/* ===== Demo modal ===== */

.demo-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.78);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.demo-modal.open {
  opacity: 1;
  visibility: visible;
}

.demo-modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.4rem;
  cursor: pointer;
  line-height: 1;
  transition: var(--tran-03);
}

.demo-modal-close:hover {
  transform: rotate(90deg);
  color: var(--primary-color-bright);
}

.demo-modal-inner {
  display: flex;
  align-items: center;
  gap: 3rem;
  max-width: 860px;
  width: 100%;
  justify-content: center;
}

/* ===== Phone frame ===== */

.demo-phone {
  flex-shrink: 0;
  width: min(300px, 38vh);
  aspect-ratio: 390 / 844;
  background: #101012;
  border: 9px solid #2a2a2e;
  border-radius: 2.6rem;
  padding: 0;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.demo-screen {
  width: 100%;
  height: 100%;
  border-radius: 2rem;
  overflow: hidden;
  background: #fff;
}

.demo-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

/* Swipe hint cursor */
.demo-phone {
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

/* ===== Caption panel ===== */

.demo-panel {
  max-width: 380px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.demo-panel-app {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary-color-bright);
}

.demo-panel-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.demo-panel-caption {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #d5d5d5;
  min-height: 5.5em;
}

.demo-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.4rem;
}

.demo-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--tran-03);
}

.demo-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.demo-dots {
  display: flex;
  gap: 0.45rem;
}

.demo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: var(--tran-03);
}

.demo-dot.active {
  background: var(--primary-color-bright);
  transform: scale(1.25);
}

.demo-counter {
  font-size: 0.75rem;
  color: #aaa;
  letter-spacing: 1px;
}

/* ===== Responsive ===== */

@media (max-width: 768px) {
  .demo-modal {
    padding: 1rem;
    align-items: flex-start;
    overflow-y: auto;
  }

  .demo-modal-inner {
    flex-direction: column;
    gap: 1.4rem;
    margin-top: 3.2rem;
    padding-bottom: 2rem;
  }

  .demo-phone {
    width: min(62vw, 42vh);
  }

  .demo-panel {
    max-width: 100%;
    text-align: center;
    align-items: center;
  }

  .demo-panel-caption {
    min-height: 0;
  }
}
