/* ==========================================================================
   VRDevAI — project detail modal

   Opens from a case-study card. Built on native <dialog>: the browser gives
   focus trapping, Escape, inert background and the top layer for free, and
   every one of those is a bug waiting to happen in a hand-rolled modal.

   Progressive enhancement, same rule as the rest of the site: with JS off the
   cards stay exactly as they are and still link to case-studies.html. Nothing
   here is required to read the page.
   ========================================================================== */

.pm {
  width: min(880px, calc(100vw - 2 * var(--sp-2)));
  max-height: min(86vh, 900px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--white);
  color: var(--text);
  overflow: hidden;
}

.pm::backdrop {
  background: rgba(7, 21, 47, 0.62);
  backdrop-filter: blur(3px);
}

.pm__scroll {
  max-height: min(86vh, 900px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ---- Header ------------------------------------------------------------ */

.pm__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
  border-bottom: 1px solid var(--line-soft);
  background: var(--white);
}

.pm__headText { flex: 1 1 auto; min-width: 0; }

.pm__title {
  margin: 0.35rem 0 0.25rem;
  font-size: var(--fs-h2);
  line-height: 1.15;
}

.pm__one {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-body);
}

.pm__close {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--white);
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.pm__close:hover { color: var(--text); border-color: var(--slate-gray); }

/* ---- Body -------------------------------------------------------------- */

.pm__body { padding: var(--sp-3); }

.pm__section + .pm__section { margin-top: var(--sp-3); }

.pm__section h4 {
  margin: 0 0 var(--sp-1);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pm__section p { margin: 0 0 var(--sp-1); }

.pm__list { margin: 0; padding-left: 1.1rem; }
.pm__list li { margin-bottom: 0.35rem; }

/* Facts strip — role, status, stack. */
.pm__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-2);
  padding: var(--sp-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md, 8px);
  background: var(--bg-alt);
}

.pm__fact strong {
  display: block;
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: var(--fw-semibold);
}

.pm__fact span { font-size: var(--fs-small); }

/* ---- Screenshots ------------------------------------------------------- */

.pm__shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-2);
}

.pm__shot { margin: 0; }

.pm__shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md, 8px);
  background: var(--bg-alt);
}

.pm__shot figcaption {
  margin-top: 0.4rem;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* Screenshots are of demonstration data, never of a real customer's system.
   Saying so on the page is the honest thing and heads off the obvious
   question — it is not fine print. */
.pm__shotsNote {
  margin: var(--sp-1) 0 0;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* ---- Footer / CTA ------------------------------------------------------ */

.pm__foot {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  border-top: 1px solid var(--line-soft);
  background: var(--white);
}

.pm__foot .btn { margin: 0; }
.pm__footNote {
  flex: 1 1 200px;
  margin: 0;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* ---- The card affordance ----------------------------------------------- */

/* The whole card becomes clickable, but the accessible control is a real
   button in the card — a div with a click handler is invisible to a keyboard
   and to a screen reader. */
.work__item { position: relative; }

.work__more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: var(--sp-1);
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  cursor: pointer;
}

.work__more::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.work__more:hover { text-decoration: underline; }

.work__more svg { width: 14px; height: 14px; fill: currentColor; }

@media (max-width: 600px) {
  .pm__head, .pm__body, .pm__foot { padding-left: var(--sp-2); padding-right: var(--sp-2); }
}

@media (prefers-reduced-motion: reduce) {
  .pm { animation: none !important; }
}
