/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


/* ===== Demo Page Background ===== */
.page-bg {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: radial-gradient(ellipse at 50% 30%, #2a2a2a 0%, #0d0d0d 100%);
}

.page-title {
  font-size: clamp(1.25rem, 4vw, 2rem);
  font-weight: 400;
  color: #ccc;
  letter-spacing: 0.05em;
}

.open-btn {
  padding: 0.7rem 2rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 40px;
  color: #ddd;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.open-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.35);
}

/* ===== Overlay ===== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ===== Modal ===== */
.modal {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: #1a1a1a;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 32px 80px rgba(0,0,0,0.7);
}

.overlay.active .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ===== Close Button ===== */
.close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  line-height: 1;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.08);
}

.close-btn:active {
  transform: scale(0.94);
}

/* ===== Image ===== */
.modal-inner {
  display: block;
  line-height: 0;
}

.modal-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 70vh;
}

/* ===== Footer Bar ===== */
.modal-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.04);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
  font-family: inherit;
}

.close-text-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
  padding: 0;
}

.close-text-btn:hover {
  color: rgba(255, 255, 255, 0.85);
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .modal {
    border-radius: 12px;
    max-width: 100%;
  }

  .close-btn {
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
  }

  .modal-footer-bar {
    padding: 0.6rem 1rem;
    font-size: 0.78rem;
  }
}

@media (min-width: 900px) {
  .modal {
    max-width: 720px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .overlay, .modal {
    transition: none;
  }
}
