/*
 * Live preview modal: #livePreviewModal is appended by portfolio-system.js on first expand (not in HTML).
 * ID + !important keeps display locked until `.is-open`.
 */
.live-preview-modal {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 10050;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}
#livePreviewModal {
  display: none !important;
}
#livePreviewModal.is-open {
  display: flex !important;
}
/* Children: keep backdrop inert until .is-open (see stacking context above nav). */
.live-preview-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
  pointer-events: none;
}
.live-preview-modal.is-open .live-preview-modal-backdrop {
  pointer-events: auto;
}
.live-preview-modal-shell {
  pointer-events: none;
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.live-preview-modal.is-open .live-preview-modal-shell {
  pointer-events: auto;
}
.live-preview-modal-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #1a1a1e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.live-preview-modal-title {
  font-size: 14px;
  font-weight: 500;
  color: rgba(240, 237, 230, 0.9);
  letter-spacing: 0.02em;
  margin: 0;
  font-family: inherit;
}
.live-preview-modal-close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: rgba(10, 10, 10, 0.75);
  color: var(--off-white);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}
.live-preview-modal-close:hover {
  background: var(--accent);
  color: #fff;
}
.live-preview-modal-body {
  flex: 1;
  min-height: min(72vh, 760px);
  position: relative;
  background: #080809;
}
.live-preview-modal-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  /* Match modal chrome so the iframe’s blank / first paint doesn’t flash white (#fff hurts badly). */
  background: #080809;
  color-scheme: dark;
  opacity: 0;
  transition: opacity 0.22s ease;
  will-change: opacity;
}
.live-preview-modal-iframe.live-preview-modal-iframe--loaded {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .live-preview-modal-iframe {
    transition: none;
  }
}
@media (max-width: 768px) {
  .live-work {
    padding: 36px 0 44px;
  }
  .live-work-inner {
    padding: 0 24px;
  }
  .live-work-frame-wrap {
    height: min(260px, 48vh);
  }
  .live-work-frame-wrap--tall {
    height: min(280px, 50vh);
  }
  .live-preview-modal-body {
    min-height: min(64vh, 560px);
  }
  .live-preview-modal-shell {
    border-radius: 10px;
    max-height: 94vh;
  }
}
@media (prefers-reduced-motion: reduce) {
  .live-work-iframe {
    opacity: 1;
    visibility: visible;
    transition: none;
  }
  .live-work-card {
    transition: none;
  }
  .live-work-placeholder {
    transition: none;
  }
  .live-work-card:hover .live-work-placeholder {
    transform: none;
  }
}
